I understand this may be able to be done with Samba? Anyone know the syntax for a CentOS 5.1 Samba client and what needs to be done to Windows 2008 Server to allow this (I suspect out of the box it wouldn't allow it)?
I was hoping to use SSH with keys and script the login and execution of the native win shutdown command, but I have had troubles making any of the usual win SSH Daemons work under Windows 2008 Server x64.
Any ideas would be appreciated! jlc
Joseph L. Casale wrote:
I understand this may be able to be done with Samba? Anyone know the syntax for a CentOS 5.1 Samba client and what needs to be done to Windows 2008 Server to allow this (I suspect out of the box it wouldn't allow it)?
I haven't tested this, but in theory...
$ net rpc shutdown -U Administrator -S servername
and it will prompt for the Administrator account password. Administrator can be replaced with any windows account that has admin privs on the target server. If its in a domain, presumably you could use DOMAINNAME\domainuser as the username, where that domainuser has admin privs on the server.
this assumes you're on the same network and not firewalled against basic RPC type operations, this would be the case in the typical business network, but NOT if the machine is hardened and running as an internet server or in a DMZ.
Joseph L. Casale wrote:
I understand this may be able to be done with Samba? Anyone know the syntax for a CentOS 5.1 Samba client and what needs to be done to Windows 2008 Server to allow this (I suspect out of the box it wouldn't allow it)?
I was hoping to use SSH with keys and script the login and execution of the native win shutdown command, but I have had troubles making any of the usual win SSH Daemons work under Windows 2008 Server x64.
winexe opens a command prompt on XP boxes. You can script the shutdown - have no idea if it'll work on 2008:
winexe -A $accountname //$computername "cmd /c shutdown -s -t 60"
and down it goes.