Ssh password less login with different ID

Thread Tools Search this Thread
Special Forums Cybersecurity Ssh password less login with different ID
# 1  
Old 12-16-2013
Ssh password less login with different ID


I have setup password less ssh connection between Server A and Server B and I am able to connect with User2.

But my requirement is, User 1 run a script in Server A to ssh into Server B as User 2 but it is asking password every time I execute.

Server A:
Login as User 1 and execute sh script, it has
/usr/bin/ssh -t user2@ServerB -- Asking password here

Server 2:
user 2 has permission to execute ServerB script

Please help me to solve this issue.
# 2  
Old 12-16-2013
How is ssh from server A to server B, setup. Did you setup this server wide or user wide. In other words, did you setup a system key or user key for user 1?
# 3  
Old 12-16-2013
Set it up for user2 the same way you set it up for user1 -- append into their authorized_keys. The same key will work for both.
# 4  
Old 12-16-2013
We have setup a public key using ssh-keygen and copied (ssh-copy-id) the file for both User 1 and User 2.

Even after setting up User 1 password less login it is not working.

I am able to ssh server A to Server B

Login as User1 at ServerA and ssh as User1@Server B
Login as User2 at ServerA and ssh as User2@Server B

but not able to do

login as User1 at ServerA and ssh as User2@Server B
# 5  
Old 12-16-2013
Then I'm pretty sure the private id_rsa is different for the two users. Make sure either id_rsa is the same on server A or serverA:user1's public is appended to serverB:user2's authorized_key and vice versa.
# 6  
Old 12-16-2013
I tried with the public key.. still it is not working...

that is I copied ServerA: user1 key and added in ServerB:User2 authorizedLkey file.
Also I tried
copying ServerA:User2 and added in ServerB:User1 auth key file.

does not work, still asking password.
# 7  
Old 12-16-2013
Check permissions on your home directories, ls -ld ~/

Being world-accessible will stop autologin from working. ssh is picky about permissions.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Need to login without password using ssh

I am using redhat 6.4 and i want to login ssh without password kindly guide me (2 Replies)
Discussion started by: kannansoft1985
2 Replies

2. Solaris

How can i setup ssh password-less login for particular user?

HI Community. I was trying to create ssh password less authentication for one user called night and it's not working for me. These are the steps I followed:- I have logged into the server and issued ssh-ketgen -t rsabash-3.2$ ssh-keygen -t rsa Generating public/private rsa key pair.... (4 Replies)
Discussion started by: bentech4u
4 Replies

3. Cybersecurity

Password less SSH login to different server

Hi, It is continuation with my other thread, The issue i found is U1 does not set properly for password less ssh. for setting up password less ssh i followed the following steps 1. ssh-keygen 2. ssh-copy-id -i ~/.ssh/ hostname 3. /usr/bin/ssh -t -t U1@hostname ... (3 Replies)
Discussion started by: sakthi.99it
3 Replies

4. Solaris

Problem with ssh login without password

Hello friends, I have the problem with password less login in solaris 10. Issue : In solaris 10 I have 2 different users on is oracle and the other is archmon. when I try to ssh to the other server from oracle it is successful but when I try to ssh from archmon it fails, and it asks for the... (1 Reply)
Discussion started by: Pavankrv
1 Replies

5. Emergency UNIX and Linux Support

SSH password login issue

Hi All, I am facing issue in setting up passwordless login through ssh on two Solaris-10 boxes. user-id ravrwa from server tsapiq04-zrwdq01 should be able to login to server tsbrit03 as cpsuserq, which is not happening. I am not sure where is the problem, while keys are already all set. Here is... (14 Replies)
Discussion started by: solaris_1977
14 Replies

6. Shell Programming and Scripting

rlogin / ssh login with password

Hello, I need to find a way to connect from server1 to 30 other servers using a single line command in order to run various command from the other 30 servers. I am looking for a single line connection command in which i can provide the server name user name and password and connect to the... (2 Replies)
Discussion started by: LiorAmitai
2 Replies

7. Solaris

expired password prompt at ssh login

Hi, I am using DSEE 6.3 to authenticate and authorize my Solaris 9 and 10 users. Everything works fine except password expiration. I use built-in global password policy for all users. The policy works well. However I could not find the right pam configuration in order to prompt users at ssh... (2 Replies)
Discussion started by: niyazi
2 Replies

8. Shell Programming and Scripting

SSH Login by passing password.

ssh/sftp login by passing password , is it possible.Don't want to expect. (1 Reply)
Discussion started by: dinjo_jo
1 Replies

9. Solaris

SSH Password-less login fails on password expiry.

Hi Gurus I have a few Sol 5.9 servers and i have enabled password less authentication between them for my user ID. Often i have found that when my password has expired,the login fails. Resetting my password reenables the keys. Do i need to do something to avoid this scenario or is this... (2 Replies)
Discussion started by: Renjesh
2 Replies

10. HP-UX

login ssh without password

There is two server, server A and server B. In server A, I would like to login ssh to server B without typing password. (no need for ssh2) Therefore, I do the followings: Server A: >cd ~ >mkdir .ssh >ssh-keygen -t dsa -f .ssh/id_dsa Then copy the file to Server B Server B:... (2 Replies)
Discussion started by: alfredo
2 Replies
Login or Register to Ask a Question