PDA

View Full Version : remote log in to a system



phillip_linux
November 6th, 2009, 11:58 AM
Hi All
I need a script for remote login into a system . during run time it should ask Ip address login id and password of a system i need to login. I'm new bee to linux. Can any one help me.
i tried like

dwhitney67
November 6th, 2009, 12:30 PM
sshlogin:


#!/bin/bash

read -p "Enter the IP address of remote system: " IP
read -p "Enter the User Id: " UserID

ssh $UserID@$IP # ssh will prompt for a password


To run the program:


$ chmod +x sshlogin

$ ./sshlogin

phillip_linux
November 6th, 2009, 12:45 PM
sshlogin:


#!/bin/bash

read -p "Enter the IP address of remote system: " IP
read -p "Enter the User Id: " UserID

ssh $UserID@$IP # ssh will prompt for a password
To run the program:


$ chmod +x sshlogin

$ ./sshlogin


Thank u very much. :)