Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSH issues 3

Status
Not open for further replies.

chieftan

MIS
Dec 18, 2002
292
GB
Any one got any ideas why SSH should work in one direction but not the other?

2 Linux boxes....... I can run SSH from one linux box to the other with no problems at all (on a cluster) but when I try and do the same thing the other way around it fails.

This causes issues for our replication services.

Can anyone help please?
 
Actually, I got that slightly wrong.....thanks for the response 'gloups'.

What I meant to say was that in one direction the connection is immediate, so replication could take place, but in the other direction it asks for a password.... this is why replication will fail.

Any ideas?
 
Make sure that the public key is exchanged in both directions.
 
just run

[code}
ssh-keygen -t rsa
[/code]

follow instructions and leave password blank if you do not want to type a password at each login.
Now, let's assume that you will name your key "myKey", linux will generate a file called myKey (private key) and a file called myKey.pub (public key)

copy the public key to the remote host and cat it into the file ~/.ssh/authorized_keys

Code:
cat myKey.pub >> /home/your_user/.ssh/authorized_keys
if root obviously the home is /root
ON the client machine start ssh-agent
Code:
ssh-agent /bin/bash

then import the private key
Code:
ssh-add myKey


CHeers

QatQat

Life is what happens when you are making other plans.
 
Okay, I have completed the above and a very strange problem is occuring:-

If I log on as root on one box I can ssh one direction but as a normal user I cant.

When I log on as root on the second box, I cant ssh but if I log on as a normal user I can.....

How weird is that.......

I have checked all the files and permissions and passwords and it still does not work.

Still, it asks for the password when trying with the opposite of what works.

 
it depends on wjere you have saved the keys.

Have you checked that each user you want to connect has its set of public/private in both machines?


QatQat



Life is what happens when you are making other plans.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top