ssh key based authentication - force


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting ssh key based authentication - force
# 1  
Old 09-09-2010
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.
Code:
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
# 2  
Old 09-09-2010
what version/vendor of SSH? I am not familer with the option your using but " --indetity=" is spelled wrong. it should be identity.
# 3  
Old 09-10-2010
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:
Code:
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!
# 4  
Old 10-27-2010
Question Same issue

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
# 5  
Old 10-27-2010
Hi,

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

Code:
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:
HTML Code:
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.

Last edited by felipe.vinturin; 10-27-2010 at 07:47 AM..
# 6  
Old 10-27-2010
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
# 7  
Old 10-27-2010
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
- https://www.unix.com/shell-programmin...ix-script.html

Regards.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. IP Networking

Cygwin remote ssh with key authentication method

Hi experts, I am not sure in which forum to submit this question. If this is not the correct place then please let me know where to submit this thread. My requirement is to invoke windows batch scripts from linux shell script. Hence, I have installed openssh in Cygwin on the windows machine.... (2 Replies)
Discussion started by: ahmedwaseem2000
2 Replies

2. UNIX for Advanced & Expert Users

SSH key authentication problem with 2 servers

hi All, this issue is regarding ssh key authentication, although i have performed this activity on two separate servers, now i have to configure the same again on 2 more servers. i did everything what i did earlier but this time i am getting some error, and i am unable to understand what exactly... (2 Replies)
Discussion started by: lovelysethii
2 Replies

3. UNIX for Advanced & Expert Users

[Solved] SSH key authentication problem

Hi All, this is the very first time i am going to use SSH authentication. first i login to server@ and under this ..ssh directory of servera i used this following command: ssh-keygen -t rsa -b 1024 and i had 2 files(bravo_dbtest and bravo_dbtest.pub) created respectively, further i copied the... (13 Replies)
Discussion started by: lovelysethii
13 Replies

4. Red Hat

ssh private key passwordless authentication

Hello, Need a suggestion to setup private key passwordless authentication. I am not sure this can done or not :wall: here is the sincerio I have two servers, sever1 with a user "user1" and servera with usera here dataflow: usera from servera, will pull/push files to server1 on user1... (2 Replies)
Discussion started by: bobby320
2 Replies

5. UNIX for Advanced & Expert Users

Is SSH Key Authentication Disabled?

I setup passwordless authentication on a Ubuntu vm by ssh'ing into the localhost. I'm trying to do the same thing on another machine but it's not working. I believe I have the permissions setup properly and keygen'd. Is there a way to disable passwordless authentication? I have permission to... (4 Replies)
Discussion started by: MaindotC
4 Replies

6. HP-UX

Error while doing key based authentication

We are trying to do a key exchange from Sun solaris server to HP UNIX server. Errro we are getting is as below:- sshd2: connection from "10.13.240.6" sshd2: auths-pam: PAM subprocess returned packet SSH_PAM_OP_ERROR. (err_num: 32, err_msg: General Commercial Security error) sshd2: User... (4 Replies)
Discussion started by: sandipmandal
4 Replies

7. Solaris

Solaris 8 ssh public key authentication issue - Server refused our key

Hi, I've used the following way to set ssh public key authentication and it is working fine on Solaris 10, RedHat Linux and SuSE Linux servers without any problem. But I got error 'Server refused our key' on Solaris 8 system. Solaris 8 uses SSH2 too. Why? Please help. Thanks. ... (1 Reply)
Discussion started by: aixlover
1 Replies

8. Red Hat

SSH Public key Authentication Issue

Hi All; I have an issue with password less authentication via ssh ( v2) I have two servers Server A and Server B, following are the server details Server A OS - HP UX B.11.11 U 9000/800 SSH - OpenSSH_4.3p2-hpn, OpenSSL 0.9.7i 14 Oct 2005 HP-UX Secure Shell-A.04.30.000, HP-UX... (3 Replies)
Discussion started by: maverick_here
3 Replies

9. Shell Programming and Scripting

Disable SSH key authentication

Hello Guys, I need your help. I am trying to create a script to change password for multipls servers but having problem when it comes to ssh key authentication. Does anyone have a sample script that will disable ssh key authentication for multiple servers?;) (3 Replies)
Discussion started by: youdexter
3 Replies

10. UNIX for Dummies Questions & Answers

SSH key authentication

Hi all, I have got a Solaris machine and I have several user account setup up with the .ssh and authorized_keys file in their home directories. I have check all the permission and ownership and they are all indentical and belongs to the user ID and group respectively. However one of the... (3 Replies)
Discussion started by: stancwong
3 Replies
Login or Register to Ask a Question