I am using putty in windows. I am logging to putty with an IP:Port number. What I have to do is I have to write a script which will open another putty terminal and do login there with its username and password
Purpose:- I am trying to automate my work using scripts, I have five users with there username and password and all of the terminal should be opened in putty and so there task.
please guide me in this direction.
I am running my script in ssh shell
My code:-
putty.exe -pw "password" username@server.com hello.sh ok-1
I have only executable file of putty, I have not installed putty, just copy and paste the exe file from another machine.Its working fine manually.
There are ways to automate this task but they may not be what you were originally anticipating.
You can pass username and password information to PuTTY via the windows command line.
Alternatively you can preload the information in a windows shortcut by passing PuTTY.exe parameters.
(More information availible in this answer: https://superuser.com/a/44117)
Both of these approaches mean storing plain text passwords which is not desirable. You should combine one of these methods with public key authentication. Say you choose windows shortcuts, you could have one for each user, the shortcut passing PuTTY the username, and the authentication is handled by stored SSH keys.
(A guide to SSH keys using PuTTY: http://www.howtoforge.com/how-to-configure-ssh-keys-authentication-with-putty-and-linux-server-in-5-quick-steps)