0

I want to open a putty session (SSH) from command line and immediately execute on the remote machine a specific command.

Something like:

putty.exe -ssh user@host -pw pass123 < "cd /some/directory; ll"

But this doesn't work. Is it possible?

Mr.Eddart
  • 111
  • 1
  • 4

1 Answers1

1

Putty also provides plink.

Usage example:

plink -ssh user@host -pw password echo "hi"

Also I suggest you to use SSH-KEY instead of password. It makes your work easier and safer. Look at Pageant and Putty Key Generator. More information about keys: https://www.digitalocean.com/docs/droplets/how-to/add-ssh-keys/create-with-putty/

Lukáš Viktora
  • 132
  • 2
  • 13