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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SFTP without prompts

Status
Not open for further replies.

MJGC

Programmer
Apr 7, 2002
7
US
Hi all,

We are having troubles trying to connect with sftp to a ssh server. Lets me tell you what the case is:

We have been given with an account 'acc2' in machine B, where the SSH server is installed. This account indeed does not exists in machine A where the SSH client resides. Then I proceed that way:

Login in machine A with an existing account 'acc1'
Generate the keys pair with 'ssh-keygen -t rsa'
Transfer the public key to machine B using the account we were given 'acc2' and store their contents in acc2's $HOME/.ssh/authorized_keys (cat id_rsa.pub >> .ssh/authorized_keys)
Change permission of .ssh/authorized_keys to 600

Then I tried to establish a SSH connection from machine A to machine B using:

Ssh -i .ssh/id_rsa acc2@machineB

But I been always prompted for the acc2 password instead of the acc1 passphrase. The trace (when using -v) indicates that the privkey authentication method does not work and the only successful one is the password method. What am I doing wrong?

Would the problem be that the keys pair must be generated using acc2 in machine A (thus the same account in both machines)?

I would appreciate very much if you can help us because I am completely lost now.

Kind regards,

MJGC
 
You did it like you should have done it. I use those type of connections every night to transfer file beetween servers.



So, be sure those parameters are correctly sets on machine B in your ssd_config file:


#RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys


Also be sure you're using ssh V2 that only permit private key authentification.



 
Thanks Gloups,

We have spent some time to verify the parameters in the server so it is not under our control. They are ok, but we have detected the problem.

The .ssh directory has to be created by server owner and it has to be included in some configuraton files. This has been the reason it has not worked until now.

Thanks a lot for yur help,

MJGC

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top