From 128f6a3ec56b4dc18a8bec1a056a075320889a4e Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Sat, 12 Mar 2005 03:03:07 +0000 Subject: [PATCH] Let user SSH in as admin instead of root only (requested for consistency) Full path to sshd --- etc/group | 2 +- etc/master.passwd | 2 +- etc/passwd | 2 +- etc/sshd | 7 +++++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/etc/group b/etc/group index cac3e1e890..b263c85685 100644 --- a/etc/group +++ b/etc/group @@ -12,4 +12,4 @@ network:*:69: www:*:80: nogroup:*:65533: nobody:*:65534: -admin:*:101: +admin:*:0: diff --git a/etc/master.passwd b/etc/master.passwd index 1e504697b8..b30360328a 100644 --- a/etc/master.passwd +++ b/etc/master.passwd @@ -22,4 +22,4 @@ www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin distcc:*:1001:1001::0:0:Distcc:/home/distcc:/sbin/nologin dhcpd:*:1002:1002::0:0:DHCP Daemon:/nonexistent:/sbin/nologin -admin:*:101:101::0:0:Admin User:/home/admin:/etc/rc.initial +admin:*:0:0::0:0:Admin User:/root:/etc/rc.initial diff --git a/etc/passwd b/etc/passwd index 227374eb3f..a4ec5de5c9 100644 --- a/etc/passwd +++ b/etc/passwd @@ -20,4 +20,4 @@ www:*:80:80:World Wide Web Owner:/nonexistent:/usr/sbin/nologin nobody:*:65534:65534:Unprivileged user:/nonexistent:/usr/sbin/nologin distcc:*:1001:1001:Distcc:/home/distcc:/sbin/nologin dhcpd:*:1002:1002:DHCP Daemon:/nonexistent:/sbin/nologin -admin:*:101:101:Admin User:/home/admin:/etc/rc.initial +admin:*:0:0:Admin User:/root:/etc/rc.initial diff --git a/etc/sshd b/etc/sshd index 58c3dbe996..11226b2057 100755 --- a/etc/sshd +++ b/etc/sshd @@ -43,10 +43,13 @@ touch("/var/log/lastlog"); } - // Make the root password the same as the admin password of m0n0. + // Make the root/admin passwords are the same as the web admin password. $fd = popen("/usr/sbin/pw usermod -n root -H 0", "w"); fwrite($fd, $config['system']['password']); pclose($fd); + $fd = popen("/usr/sbin/pw usermod -n admin -H 0", "w"); + fwrite($fd, $config['system']['password']); + pclose($fd); $sshConfigDir = "/etc/ssh"; if (!file_exists("$sshConfigDir/ssh_host_key")) { @@ -56,7 +59,7 @@ } // And finally ... - system("sshd"); + system("/usr/sbin/sshd"); fwrite($stderr, "Done.\n"); ?>