Deepak Agarwal
Explorer
- Joined
- Dec 6, 2013
- Messages
- 61
Hi Everyone
I thought its best to have a separate thread for this one. I need to be able to turn of the FreeNAS PC using a batch script file from Windows PC using PuTTy SSH (Neither Plink nor public key authentication for PuTTy SSH seem to work for me).
I have created a password authenticated (for some reason my public key authentication doesn't seem to work) PuTTy session that works and I am able to log in by either typing the following command at the dos prompt or having that in a batch file :-
putty -ssh anyone@192.168.1.10 -pw mypassword
What I want to do is to use the -m option which, I understand, requires a local (not sure if this is supposed to be local to the Windows PC or the FreeNAS PC) script file that contains the command to be run on the linux/freeBSD terminal like so :-
putty -ssh anyone@192.168.1.10 -pw mypassword -m "D:\FreeNAS_Server_Shutdown_Files\ShutdownFreeNASCmdFile.txt"
In the above statement, the .txt file is local to my Windows PC.
The file "ShutdownFreeNASCmdFile.txt" contains this command
sudo shutdown -p now
But that didn't work!
I also tried it with this command in the file
./.ssh/shutdownfreenas.txt - running this command under "anyone" or root login (from shell) gave permission denied error even the sudoers file in /conf/base/etc/local/sudoers has these lines :-
anyone ALL=(ALL) NOPASSWD: ALL
%wheel ALL=(ALL) NOPASSWD: ALL
The shutdownfreenas.txt file contains the "sudo shutdown -p now" command
Any suggestions?
Best regards
Deepak
I thought its best to have a separate thread for this one. I need to be able to turn of the FreeNAS PC using a batch script file from Windows PC using PuTTy SSH (Neither Plink nor public key authentication for PuTTy SSH seem to work for me).
I have created a password authenticated (for some reason my public key authentication doesn't seem to work) PuTTy session that works and I am able to log in by either typing the following command at the dos prompt or having that in a batch file :-
putty -ssh anyone@192.168.1.10 -pw mypassword
What I want to do is to use the -m option which, I understand, requires a local (not sure if this is supposed to be local to the Windows PC or the FreeNAS PC) script file that contains the command to be run on the linux/freeBSD terminal like so :-
putty -ssh anyone@192.168.1.10 -pw mypassword -m "D:\FreeNAS_Server_Shutdown_Files\ShutdownFreeNASCmdFile.txt"
In the above statement, the .txt file is local to my Windows PC.
The file "ShutdownFreeNASCmdFile.txt" contains this command
sudo shutdown -p now
But that didn't work!
I also tried it with this command in the file
./.ssh/shutdownfreenas.txt - running this command under "anyone" or root login (from shell) gave permission denied error even the sudoers file in /conf/base/etc/local/sudoers has these lines :-
anyone ALL=(ALL) NOPASSWD: ALL
%wheel ALL=(ALL) NOPASSWD: ALL
The shutdownfreenas.txt file contains the "sudo shutdown -p now" command
Any suggestions?
Best regards
Deepak