Connecting Server by script using Putty (Linux to Linux)

Connecting Server by script using Putty (Linux to Linux)

Create a script file with following content

cat myserver.sh

putty -ssh -pw 'password' -l user IP -P port -geometry 1024x786 -fg black -bg white -fn 10x20 &

where value need to put for following parameter

1) password :- Password for User 
2) user          :- User Name by which you want to connect IP address
3) port          :- Open Port number for that IP address

Give the execute permission for script by below command

chmod a+x myserver.sh

To connect the server, you can use one of the below commands

1) ./myserver.sh (This will run only when execute permission is there)
2) sh myserver.sh (This will be run without execute permission as well)

Note:- Putty application should be installed on your Linux OS

1 comment: