Sponsored Content
Operating Systems Linux Ubuntu Passwordless ssh authentication fails Post 302735267 by frappa on Saturday 24th of November 2012 04:00:37 AM
Old 11-24-2012
Hi tkota:

1. the sshd_config files seems ok, I don't think you should edit it.

2. check for correct permissions on the server-side ~/.ssh directory of the user you are going to login with; they should be:
700 (rwx --- ---) for ~/.ssh directory
600 (rw- --- ---) for all the files inside ~/.ssh directory

3. please check that the public key you are using to perform passwordless authentication is correctly stored in server-side file ~/.ssh/authorized_keys
The format of the key should be something like:
Code:
ssh-rsa hkbvfggkwbugjbvwulbvgawDDHSFYGFVDKJCBK+89u8aunLJDBHUOGHzwyZK4PpmV1cA4D/l3WbjNKLWGN/ERWGPWMBVFI9PWHJVWERIQVH80H80WERHVQWRV+M0vbqQPnj/EkJ0HpF5xAxOEcYlb57GNV/5CKjai9z1DFIUaeJM8vj+f1ztDcj71s6vIw5Vm5EA+gk2Vj4siYhg08NUtCrdRWmFgmaf2wM0MrblJtbzeeOLwcWVyQzDpxLlhqpA76mgpO0TvALJJOHWw/+/GFUWET76T893T45GI2GD67WTgyd789g34ibgrifh0peh34n2f+f2jh0cbhkjb98gTFVCXDUCCFYKGILYPYPghkbfhkbwekfwe8ebncfwhc8o0wechppenc2q0pj+mknbn0B4pA9XJkvrD2Zi+pdV8U3nuTTUZTAysXdN8dV/xV3s6W9ENHhVulNZ5vmerWmAAvm1OBH0jPWipDagPhBZ1c+WVPDmYLbWKTGHTsOfDH0/+JFc8zCgtxkz10Z8x6efRjTQMkl6T988YlLAeBhRtPQ/of5mJ9kKOg4Ynyc9uHv+gY48VkpUoQQUGjkGOjMYQ4PR/tkQE6xqaOAEhWN79oys2R47f36aCkKOd7S8hxJ7AauMSCpBg/+3ClTeX8VdUsUZhAWtKwacicBVlQuSyUBByh2JhJkQX2fPsxF5uf9fOcl9hac= user@remotehost

be aware that the newlines in public key are just a consequence of the fact that the text may be wrapped by the text editor/viewer: the key itself should not contain newline characters (sometimes ssh_keygen on windows may produce weird output results).
For the same reason, if you generated the key pair on a windows machine, make sure to sanitize the content of the private and public key in order to comply with the server newline standard (see for example 'man dos2unix').

4. when invoking ssh on the client, please remember to specify the user to login with and try to explicitly indicate the private key you want to use in order to authenticate (using the -i switch of ssh).

see ya
fra
 

10 More Discussions You Might Find Interesting

1. AIX

Passwordless authentication via SSH

I am trying to implement passwordless authentication via ssh2. I have used the well documented technique of generating a key pair with a blank passphrase on my client machine, and installing the public key on the destination server (AIX 5.3) in the user's .ssh2 directory. I have used this technique... (1 Reply)
Discussion started by: RegX
1 Replies

2. AIX

Passwordless root authentication via SSH

Hello, I would like to issue a couple of commands as root on a remote machine without having to enter the root password. I used "ssh-keygen -t rsa" to generate the encryption keys, copied the public key to the remote machine, etc. I also tried playing around with the sshd_config file and... (3 Replies)
Discussion started by: sphericon
3 Replies

3. HP-UX

Help on passwordless ssh...

Hi, Can someone help me on ssh-keygen usage...? I used ssh-keygen after which "id.pub" file was generated in system1's > .ssh directory... I copied the same into the remote system system2 > .ssh directory as "authorized_keys" file. Now i tried ssh connection from system 1 to system... (7 Replies)
Discussion started by: EmbedUX
7 Replies

4. Shell Programming and Scripting

passwordless authentication of SFTP script

Dear All I need to discuss about the problem which has been discussed so many times here. I need to transfer a file from server A to server B via passwordless SFTP script. By reading the threads on this topic here, I followed the below steps but still it's not working .. Pls find the steps... (13 Replies)
Discussion started by: uday.shankar
13 Replies

5. Shell Programming and Scripting

Setup multiple passwordless authentication

I have experience in setting up passwordless authentication by sharing ssh public keys manually.Currently I am in the process to the write a script to perform the same functionality from one source(host) to multiple destinations. I have one source host (Host A) whose public keys has to be shared... (9 Replies)
Discussion started by: Lancel0t
9 Replies

6. UNIX for Dummies Questions & Answers

passwordless ssh

hi, i have tried with passwordless shh in google.. i followed the below steps ... user:~> ssh-keygen -t rsa Enter file in which to save the key (/home/cantin/.ssh/id_rsa):key.txt Enter passphrase (empty for no passphrase): Enter same passphrase again: till this step i... (0 Replies)
Discussion started by: arunmanas
0 Replies

7. 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

8. UNIX for Dummies Questions & Answers

[Solved] Passwordless authentication lost between cluster nodes

after copying the public key then also the passwordless authentication is not working Best regards, Vishal (2 Replies)
Discussion started by: Vishal_dba
2 Replies

9. Shell Programming and Scripting

Passwordless Authentication and Anonymous login

Hi, I am in the process FTPing some of my report files from my production server to another FTP server through batch/Shell Script. This is working fine with the password less authentication. Once i place all my report files in the ftp server the end users need to download ... (3 Replies)
Discussion started by: Showdown
3 Replies

10. Shell Programming and Scripting

Ssh passwordless authentication

Hey team I have to enable password less authentication betweeen A to B server and A to C server and A to D server. For this I generated a ssh key on server A using ssh-keygen command and copied the key using ssh-copy-id command to B, C and D server. Everything is working fine as of now but... (5 Replies)
Discussion started by: Sandeep_sandy
5 Replies
SSH-KEYCONVER(1)					    BSD General Commands Manual 					  SSH-KEYCONVER(1)

NAME
ssh-keyconvert -- convert ssh v1 keys and authorization files SYNOPSIS
ssh-keyconvert [-k] [-o output_file] identity_file ... ssh-keyconvert [-a] [-o output_file] authorization_file ... DESCRIPTION
ssh-keyconvert converts RSA public and private keys used for public key based user authentication with protocol version 1 to the format used with protocol version 2. When using RSA user authentication with SSH protocol version 1, the client uses the private key from $HOME/.ssh/identity to provide its iden- tity to the server. The server grants or denies access based on whether the public part of this key is listed in $HOME/.ssh/authorized_keys. SSH protocol version 2 supports both DSA and RSA keys, but the way RSA keys are stored are differently. On the client, the default file name is .ssh/id_rsa rather than .ssh/identity, and the file's format is different as well. On the server, the public porting of the key can still be stored in .ssh/authorized_keys, but the key notation has changed as well. Therefore, when switching from protocol version 1 to version 2, you either have to create a new identity key using ssh-keygen(1) and add that key to the server's authorized_keys file, or you need to con- vert your keys using ssh-keyconvert. By default, ssh-keyconvert will try to guess the type of file that is to be converted. If it fails to guess correctly, you can tell if what type of conversion to perform by specifying the -k option to convert the private key, or the -a option to convert an authorisation file. When converting your private keys stored in .ssh/identity, ssh-keyconvert will read the private key, prompting you for the pass phrase if the key is protected by a pass phrase. If the -o option is given, it will write the private key to the specified file, using version 2 syntax. If the key was protected by a pass phrase, it will use the same pass phrase to protect the new file. It will also write the public portion of the key to a second file, using the specified file name with ``.pub'' appended. If the -o option was not given, private and public key will be written to id_rsa and id_rsa.pub, respectively, relative to the directory of the input key file. If the destination file already exists, ssh-keyconvert will prompt the user for confirmation before overwriting the file, unless the -f option is given. When converting your authorized_keys file, ssh-keyconvert will ignore any keys in SSH version 2 format. Any public keys in version 1 format will be converted and appended to the output file using the new syntax. If the -o option is given, keys are appended to the specified file. If it is not given, ssh-keyconvert will append all keys to the input file. Note that ssh-keyconvert does not check for duplicate keys, so if you run it on .ssh/authorized_keys more several times, the converted keys will show up several times. OPTIONS
-k Convert private key file(s). The default is to guess the type of file that should be converted. -a Convert authorized_keys file(s). The default is to guess the type of file that should be converted. -o outfile Specify the name of the output file. When converting an authorization file, all public keys will be appended to this file. For pri- vate key conversion, the private and public components of the key will be stored in outfile and outfile.pub, respectively. Note that since every key must be stored in a separate file, you cannot use this option when you specify several input files. -f When converting a key file, and the output file already exists, ssh-keyconvert will ask the user whether to overwrite the file. Using this option forces overwriting. AUTHORS
OpenSSH is a derivative of the original and free ssh 1.2.12 release by Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo de Raadt and Dug Song removed many bugs, re-added newer features and created OpenSSH. ssh-keyconvert was contributed by Olaf Kirch. SEE ALSO
ssh(1), ssh-add(1), ssh-agent(1), sshd(8) J. Galbraith and R. Thayer, SECSH Public Key File Format, draft-ietf-secsh-publickeyfile-01.txt, March 2001, work in progress material. BSD
February 2, 2002 BSD
All times are GMT -4. The time now is 10:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy