10-28-2010
ssh to remote machine with 2nd user and password
Hi all,
Really hope someone can help me, i have been trying lots of things and just cant seem to nail it - and for something that seems straight forward....
Anyway, scenario is I need to log onto a second machine (remote server) from main workstation. Once logged in I need to run a batch job, then log out and return to main workstation. I am scripting to do this automatically, therefore any passwords need to be automatically entered.
I have set up key pairs for the initial user, so I do not get prompted for the auth password into second machine, problem is I need to log into the second machine as another user so I am doing ssh -l user@host2.
The connection is being made but I am then prompted for a second password which has to be entered to allow access to relevant user directory.....I can not seem to get my script to pass through a password to the 'Password:' prompt.....the second machine then timesout and the password then echos to screen afterwards.....annoying.
Has anyone got any ideas? Experienced something similar?
Thanks a million
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to search and remove files from a list of servers. I want to find every occurence of this file on each machine and then remove it. If I execute the find command on the remote machine I would like to be able to pipe the output to xargs and remove the file. Does anyone know hat would be... (1 Reply)
Discussion started by: sewood
1 Replies
2. Shell Programming and Scripting
HI,
I need to write a script ..
when I run this script , will directly goto that remote machine without asking password..
Once it is entered, I needs to transfer some of the log files...
how can I proceed ? (7 Replies)
Discussion started by: hegdeshashi
7 Replies
3. Shell Programming and Scripting
I have a task requiring that USER_A run a script, which connects to HOST_B as USER_B and does not ask for a password.
If I am logged in on HOST_A as USER_B, I can connect to HOST_B without a password, no problem. However, if I try running ssh with the command line "ssh USER_B@HOST_B" while... (3 Replies)
Discussion started by: Totengraber
3 Replies
4. Shell Programming and Scripting
Hi!
I have two solaris 10 machines(say 10.1.1.1,10.1.1.2). i have installed rsync on 10.1.1.2,
10.1.1.1:::
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
-bash-3.00$ ssh 10.1.1.2 "echo $PATH"
Password:... (4 Replies)
Discussion started by: dddkiran
4 Replies
5. Shell Programming and Scripting
Day before yesterday,I got the success creating a shell script using expect tool and now it is running successfully on the server.
Now I want to make some changes in paswwordchanger.sh as you can see it can handle only one user i.e dbaguest and not other user.So I am thinking the logic how I can... (0 Replies)
Discussion started by: manish_1678
0 Replies
6. Solaris
how to login with ssh to remote system with out applying the remote root/user password
with rlogin we can ujse .rhosts file
but with ssh howits possible
plz guide (2 Replies)
Discussion started by: tv.praveenkumar
2 Replies
7. Shell Programming and Scripting
Hello to all
Background info:
Local machine : Linux, /bin/bash
Remote machine (for the user used for ssh) : SunOs, /bin/ksh
(so we have different OS, different Shells)
My problem :
From the local host i execute
$ var=bla
$ result=$(ssh -q user@remote-machine "
> echo \"this is... (12 Replies)
Discussion started by: black_fender
12 Replies
8. Red Hat
I want to SSH to 192.168.1.15 Server from my machine, my ip was 192.168.1.99
Source Destination was UP, with IP 192.168.1.15.
This is LAN Network there are 30 Machine's Connected to the network and working fine, I'm Playing around the local machine's because I need to apply the same rules in... (2 Replies)
Discussion started by: babinlonston
2 Replies
9. Linux
How to execute a script in remote machine through ssh
I have a script test.sh which does some backup activity in remote machine. Wanted to keep backup also in remote machine.
ssh -l username <remote machine> "commands to be exceuted as ; separted"
but how to put the script in the place of... (5 Replies)
Discussion started by: sanvel
5 Replies
10. Shell Programming and Scripting
Hello I am writing a script in a local machine, i am using ssh, here i am not able to using back ticks & input file to while loop. here is my script
ssh -q server1
a=`ps -ef | grep ccms | awk {print $1}`
b=`ps -ef | grep mss | awk {print $1}`
# above lines are not working, so i redirected... (12 Replies)
Discussion started by: nanz143
12 Replies