I have to run a bunch of commands for a process. I am able to call and login to Putty using the command below and want to be able to execute tar and other things.
I call putty using the following
"C:\Users\PSingh69\Desktop\putty.exe -ssh"&" "&UserName & "@10.177.104.109 -pw" &" "&Passwrd
Commands to send to the remote host using Putty:
cd /psingh69/home/
tar -cvf /psingh69/home/inbox/myfile.tar ./home/inputfiles/myfile.txt
tar -tvf /psingh69/home/inbox/myfile.tar
cd /psingh69/home/destfolder/inbox/
chmod 777 /psingh69/home/destfolder/inbox/myfile.tar
I am able to login to Putty using above command, but I am not sure of how to make the remote host run the above lines.
chmod 777is wrong and dangerous. You should switch back to sane permissions ASAP (probably 755 for your particular user case). If you did this on a production system, at a minimum check whether an intruder could have abused this security flaw; in the worst case, reinstall the system from scratch from known-good backups.