ssh key based authentication - force

Hi Team,
we have problem with sftp. Though SA team has setup the keys between 2 server, sftp still prompts for the password. After many attempt to rectify the problem, SA has asked us force the SSH key based authentication by using following command.

sftp2 --indetity="folder/private_key

"
Unfortunetly, i could not able to find out help on google for above command... appreciate if someone can help to on how can we force SSH key based authentication for SFTP ot SFTP2

what version/vendor of SSH? I am not familer with the option your using but " --indetity=" is spelled wrong. it should be identity.

Are you sure that the keys setup were done correctly?

Try to use ssh first, as all authentication is done based on it, and after we can go to sftp.

The following works to me:

ssh -C -i folder/private_key -l <RemoteUser> <RemoteServer>

I have had some problems in Windows with CopSSH, that I really needed to specify the ssh key in command line, but in general, it works ok.

Also, check this link: OpenSSH Public Key Authentication

Regards!

Hi ,

I am also facing the same issue . I have exchanged the keys and the installation is proper(as per the remote server admin's). but i am still getting the password prompt.

I tried SSH option given above but no luck.Even couldnt find any help for sftp --identity option over the net.

Could you please provide some help on this ?

Thanks in advance..

Regards,
Mohan

Hi,

Have you tried to analyze SSH's verbose output "-vvv"?

ssh -vvv -C -i folder/private_key -l <RemoteUser> <RemoteServer>

The link I posted above is not working anymore, but here is another one: Getting started with SSH - Kimmo Suominen

Pay attention to the permissions on the .ssh and authorized_keys files:

To make the remote system allow access you must change the permissions to disallow writing by others than the owner.
  hrothgar% cd
  hrothgar% chmod go-w . .ssh .ssh/authorized_keys
Remember to do this on all the systems you want to have access to.

Regards.

Hi,

the write permission to authorized keys should be given in remote server. please correct me if i am wrong.

Also, what is the SFTP command i should use if the above step is done?

Thanks & Regards,
Mohan

The write permissions must be set in the remote host, but it is a good practice to set it in the local host/local user, too.

About the SFTP, you can search the posts in the forum for this.

Here are two links:
- sftp - Linux Command - Unix Command
- automate sftp using unix script

Regards.