reino
1st October 2010, 11:48 PM
Hi all,
I try to shutdown a box running Fedora (fc12, all updates applied) remotely. From various threats I selected the following way that suits best to my needs:
I edited the entry for shutdown in /etc/passwd:
shutdown:x:6:0:shutdown:/sbin:/usr/bin/sudo /sbin/shutdown -h +1
Logging in from a tty with shutdown gives the desired result: The computer does the shutdown.
Then I tried the same using sshd and plink:
plink -t -l shutdown -pw xxx 10.0.0.123
As a result I get:
Using username "shutdown".
Access denied
Access denied
shutdown@10.0.0.123's password:
The /var/log/secure shows the following entry:
Oct 2 00:40:46 rotgschirr sshd[6841]: User shutdown not allowed because shell /usr/bin/sudo /sbin/shutdown -h +1 does not exist
Oct 2 00:40:46 rotgschirr sshd[6846]: input_userauth_request: invalid user shutdown
Oct 2 00:40:46 rotgschirr unix_chkpwd[6847]: password check failed for user (shutdown)
Oct 2 00:40:46 rotgschirr sshd[6841]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=rotgschirr.totes-gebirge user=shutdown
Oct 2 00:40:48 rotgschirr sshd[6841]: Failed password for invalid user shutdown from 10.0.0.123 port 37195 ssh2
Oct 2 00:40:50 rotgschirr sshd[6846]: Connection closed by 10.0.0.123
Somehow when using ssh the shell /usr/bin/sudo /sbin/shutdown -h +1 cannot be found. Does anyone know how I could overcome this problem?
Any help appreciated,
thank you and best regards,
Reinhard
I try to shutdown a box running Fedora (fc12, all updates applied) remotely. From various threats I selected the following way that suits best to my needs:
I edited the entry for shutdown in /etc/passwd:
shutdown:x:6:0:shutdown:/sbin:/usr/bin/sudo /sbin/shutdown -h +1
Logging in from a tty with shutdown gives the desired result: The computer does the shutdown.
Then I tried the same using sshd and plink:
plink -t -l shutdown -pw xxx 10.0.0.123
As a result I get:
Using username "shutdown".
Access denied
Access denied
shutdown@10.0.0.123's password:
The /var/log/secure shows the following entry:
Oct 2 00:40:46 rotgschirr sshd[6841]: User shutdown not allowed because shell /usr/bin/sudo /sbin/shutdown -h +1 does not exist
Oct 2 00:40:46 rotgschirr sshd[6846]: input_userauth_request: invalid user shutdown
Oct 2 00:40:46 rotgschirr unix_chkpwd[6847]: password check failed for user (shutdown)
Oct 2 00:40:46 rotgschirr sshd[6841]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=rotgschirr.totes-gebirge user=shutdown
Oct 2 00:40:48 rotgschirr sshd[6841]: Failed password for invalid user shutdown from 10.0.0.123 port 37195 ssh2
Oct 2 00:40:50 rotgschirr sshd[6846]: Connection closed by 10.0.0.123
Somehow when using ssh the shell /usr/bin/sudo /sbin/shutdown -h +1 cannot be found. Does anyone know how I could overcome this problem?
Any help appreciated,
thank you and best regards,
Reinhard