I need to login into remote server daily and perform same set of tasks. I am using Windows platform and the remote server is Unix. I use PuTTY to login to remote server. To reduce the manual work, I need to automate this task.
I tried this code:
start putty.exe -ssh -load session -l username -pw password -m command.txt -t
The command.txt
contains:
sudo su - user1 ls cd directory
Only the first command in command.txt
is working and then PuTTY is expecting input from user.
I need all the commands to be run without user input.
Things that matters :
I am not root user
Access granted to switch to the
user1
without passwordI have a constraint of using PuTTY only (Plink installation is notpermitted)