Howto Linux / UNIX setup SSH with DSA public key authentication (password less login)

by Vivek Gite · 27 comments

Q. How do you set-up SSH with DSA public key authentication? I have Linux laptop called tom and remote Linux server called jerry. How do I setup DSA based authentication so I don’t have to type password?

A. DSA public key authentication can only be established on a per system / user basis only i.e. it is not system wide. You will be setting up ssh with DSA public key authentication for SSH version 2 on two machines:

#1 machine : your laptop called tom
#2 machine : your remote server called jerry

Command to type on your laptop/desktop (local computer)

First login to local computer called tom and type the following command.

Step #1: Generate DSA Key Pair

Use ssh-keygen command as follows:
$ ssh-keygen -t dsa
Output:

Enter file in which to save the key (/home/vivek/.ssh/id_dsa):  Press [Enter] key
Enter passphrase (empty for no passphrase): myPassword
Enter same passphrase again: myPassword
Your identification has been saved in /home/vivek/.ssh/id_dsa.
Your public key has been saved in /home/vivek/.ssh/id_dsa.pub.
The key fingerprint is:
04:be:15:ca:1d:0a:1e:e2:a7:e5:de:98:4f:b1:a6:01 vivek@vivek-desktop

Caution: a) Please enter a passphrase different from your account password and confirm the same.
b) The public key is written to /home/you/.ssh/id_dsa.pub.
c) The private key is written to /home/you/.ssh/id_dsa.
d) It is important you never-ever give out your private key.

Step #2: Set directory permission

Next make sure you have correct permission on .ssh directory:
$ cd
$ chmod 755 .ssh

Step #3: Copy public key

Now copy file ~/.ssh/id_dsa.pub on Machine #1 (tom) to remote server jerry as ~/.ssh/authorized_keys:
$ scp ~/.ssh/id_dsa.pub user@jerry:.ssh/authorized_keys

Command to type on your remote server called jerry

Login to your remote server and make sure permissions are set correct:
$ chmod 600 ~/.ssh/authorized_keys

Task: How do I login from client to server with DSA key?

Use scp or ssh as follows from your local computer:
$ ssh user@jerry
$ ssh user@remote-server.com
$ scp file user@jerry:/tmp

You will still be asked for the passphrase for the DSA key file each time you connect to remote server called jerry, unless you either did not enter a passphrase when generating the DSA key pair.

Task: How do I login from client to server with DSA key but without typing a passhrase i.e. password-less login?

Type the following command at shell prompt:
$ exec /usr/bin/ssh-agent $SHELL
$ ssh-add

Output:

Enter passphrase for /home/vivek/.ssh/id_dsa: myPassword
Identity added: /home/vivek/.ssh/id_dsa (/home/vivek/.ssh/id_dsa)

Type your passhrase once. Now, you should not be prompted for a password whenever you use ssh, scp, or sftp command.

If you are using GUI such as Gnome use the command:
$ ssh-askpass
OR
$ /usr/lib/openssh/gnome-ssh-askpass

To save your passphrase during your GNOME session under Debian / Ubuntu, do as follows:
a) Click on System
b) Select Preferences
c) Select Session
d) Click on New
e) Enter "OpenSSH Password Management" in the Name text area
f) Enter /usr/lib/openssh/gnome-ssh-askpass in the command text area.
Howto Linux / UNIX setup SSH with DSA public key authentication
g) Click on close to save the changes
h) Log out and then log back into GNOME. After GNOME is started, a dialog box will appear prompting you for your passphrase. Enter the passphrase requested. From this point on, you should not be prompted for a password by ssh, scp, or sftp.

Featured Articles:

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 27 comments… read them below or add one }

1 Kiran 05.23.07 at 6:14 am

Try ssh-copy-id to copy your keys ,,,

2 ricc 05.31.07 at 7:03 am

Vivek,

A small suggestion. Instead of

scp ~/.ssh/id_dsa.pub user@jerry:.ssh/authorized_keys

It is better to copy it in some other name and append the contents of the authorized_keys file with the contents of the id_dsa.pub file.

This way if there are any existing keys in the file, it will not get overwritten.

ricc

3 nixcraft 05.31.07 at 9:04 am

Kiran and ricc.

Good suggestions.

Appreciate your posts!

4 Edmund 06.14.07 at 3:02 pm

Hi,
I am trying to connect from a UNIX machine to a Windows SSH server without a password entry.
I tried the steps above but I have no luck in doing it.
Any suggestions?

5 Pat 09.26.07 at 7:54 pm

It works as fine as clear it is…..

Thanks

6 vishwa 12.10.07 at 6:41 pm

I have tried this several times. Doesent seem to work. What am I missing. Can some one try it out on the same m/c with two different a/cs and confirm it again.

7 BlackNight 12.21.07 at 8:58 pm

Thanks. Useful.

8 Ali Saeed 01.20.08 at 4:59 pm

Hi Experts,

password less login information is really helpful however it does not fullfil my requirement.

I have more than 200 machines in my network running linux and I want to be able to ssh to each one of them using thier IP address from a file and then run some commands inside each and then log out.

Now, using key-gen is not practical for me and I do not want to install the “expect” utility due to some reason.

Please tell me if there is any way to supply ssh password using bash scripting? I know supplying the password in script might not be very secure, but still I want to do it this way. I shall be greatful to any help.

Regards, R.

9 Amit 09.19.08 at 10:28 pm

well there is no such need of doing login and executing commands u can just send the commands to the other machines
eg

ssh -i publicKeyFile 192.168.XXX.XXX “poweroff”

just put this in loop and put some variable for XXX values which has to be modified in each iteration based on your network IP addresses.

10 John 10.24.08 at 4:52 pm

This command needs to be executed on Tom. It think that’s where some might have gotten confused when trying to do no password.

$ exec /usr/bin/ssh-agent $SHELL
$ ssh-add

11 Balakumar 01.16.09 at 7:24 am

Thank U so Much for nice Post

12 Gautham 02.13.09 at 11:59 pm

Really very useful & Cristal clear explanation…!

Thanks for sharing your knowledge…!

13 Merhan 03.26.09 at 7:29 pm

In the 3rd step, before you execute the following command:
scp ~/.ssh/id_dsa.pub user@jerry:.ssh/authorized_keys
you need to make sure that the home dir in jerry (remote computer) has a .ssh folder. Other wise, you need to create this folder in the remote computer before executing the above command.

14 Nazooran 03.28.09 at 2:10 pm

Dear Experts,

I have one HP and other Solaris, say hp1 and sol1
Created DSA key in hp1 populated public key to sol1 and appended in authorized_keys
But while I am doing ssh it is asking password.
During troubleshooting it was showing the following output:
bash$ sftp -v -v -v m1user@sol1
Connecting to sol1…
OpenSSH_4.3p2-hpn, OpenSSL 0.9.7i 14 Oct 2005
HP-UX Secure Shell-A.04.30.000, HP-UX Secure Shell version
debug1: Reading configuration data /opt/ssh/etc/ssh_config
debug3: RNG is ready, skipping seeding
debug2: ssh_connect: needpriv 0
debug1: Connecting to sol1 [10.23.45.67] port 22.
debug1: Connection established.
debug1: identity file /batch/.ssh/id_rsa type -1
debug3: Not a RSA1 key file /batch/.ssh/id_dsa.
debug2: key_type_from_name: unknown key type ‘—–BEGIN’
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type ‘—–END’
debug3: key_read: missing keytype
debug1: identity file /batch/.ssh/id_dsa type 2
debug1: Remote protocol version 2.0, remote software version Sun_SSH_1.1
debug1: no match: Sun_SSH_1.1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3p2-hpn
debug2: fd 5 setting O_NONBLOCK
debug3: RNG is ready, skipping seeding
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-gro
up14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour1
28,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-c
tr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour1
28,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-c
tr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@open
ssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@open
ssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: gss-group1-sha1-toWM5Slw5Ew8Mqkay+al2g==,diffie-hellm
an-group-exchange-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes128-cbc,arcfour,3des-cbc,blowfish-cbc
debug2: kex_parse_kexinit: aes128-ctr,aes128-cbc,arcfour,3des-cbc,blowfish-cbc
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit: i-default
debug2: kex_parse_kexinit: i-default
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_init: found hmac-md5
debug1: kex: server->client aes128-cbc hmac-md5 none
debug2: mac_init: found hmac-md5
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 142/256
debug2: bits set: 506/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: filename /batch/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug3: check_host_in_hostfile: filename /batch/.ssh/known_hosts
_hosts
debug3: check_host_in_hostfile: match line 1
debug1: Host ’sol1′ is known and matches the RSA host key.
debug1: Found key in /batch/.ssh/known_hosts:1
debug2: bits set: 514/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /batch/.ssh/known_hosts/id_rsa (0)
debug2: key: /batch/.ssh/known_hosts/id_dsa (4002ecf8)
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publicke
y,password,keyboard-interactive
debug3: start over, passed a different list gssapi-keyex,gssapi-with-mic,publick
ey,password,keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /batch/.ssh/known_hosts/id_rsa
debug3: no such identity: /batch/.ssh/known_hosts/id_rsa
debug1: Offering public key: /batch/.ssh/known_hosts/id_dsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publicke
y,password,keyboard-interactive
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 1
Password:

Please provide your feed back

Thanks in advance
Nazoor

15 Milan 05.27.09 at 6:57 pm

I’ve set up ssh with DSA public key authentication to be able to scp without a password. I’ve got a script that I run from a Red Hat Linux box (v.4 64-bit) that uses scp to copy a couple of files to a Solaris box, which works fine without a password. (It also works copying to a Mac OSX box.) However, the exact same script doesn’t work when I try to call it from a cron job.

The relevant differences of the very verbose log files from (1.) the successful commmand-line scp and (2.) the failed cron job scp are below. Do you have any ideas of how to get my cron scp job to work? I notice that the unsuccessful script run from the cron job looks in .sssh/identity and .ssh/id_rsa first (for a private key?) before looking in .ssh/id_dsa. Though the script run from the cron job eventually accepts the public key, the PEM_read_PrivateKey fails immediately thereafter and the copy fails. Conversely, and successfully, the same script called from the command line checks in .ssh/id_dsa first and succeeds with the publickey authentication (without ever looking at .ssh/identity and .ssh/id_rsa twice!) I’d very much appreciate any help you may be able to lend. Thanks very much.

1. Successful scp called from command-line script

Executing: program /usr/bin/ssh host test.ucsd.edu, user Foobar, command scp -v -p -t /Users/Foobar/Documents
OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003
debug1: Reading configuration data /etc/ssh/ssh_config
. . .
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/Foobar/.ssh/id_dsa (0x. . .)
debug2: key: /home/Foobar/.ssh/identity ((nil))
debug2: key: /home/Foobar/.ssh/id_rsa ((nil))
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password,keyboard-interactive
debug1: Next authentication method: gssapi-with-mic
debug2: we sent a gssapi-with-mic packet, wait for reply
debug1: Miscellaneous failure
Unknown code krb5 195

debug1: Trying to start again
debug2: we sent a gssapi-with-mic packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password,keyboard-interactive
debug2: we did not send a packet, disable method
debug1: Next authentication method: publickey
debug1: Offering public key: /home/Foobar/.ssh/id_dsa
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-dss blen 433
debug2: input_userauth_pk_ok: fp 3f:4a:64: . . .
debug1: Authentication succeeded (publickey).
. . .
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.1 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 0

2. Unsuccessful scp called from cron-job script

Executing: program /usr/bin/ssh host test.ucsd.edu, user Foobar, command scp -v -p -t /Users/Foobar/Documents
OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003
debug1: Reading configuration data /etc/ssh/ssh_config
. . .
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/Foobar/.ssh/identity ((nil))
debug2: key: /home/Foobar/.ssh/id_rsa ((nil))
debug2: key: /home/Foobar/.ssh/id_dsa (0x. . .)
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password,keyboard-interactive
debug1: Next authentication method: gssapi-with-mic
debug2: we sent a gssapi-with-mic packet, wait for reply
debug1: Miscellaneous failure
Unknown code krb5 195

debug1: Trying to start again
debug2: we sent a gssapi-with-mic packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password,keyboard-interactive
debug2: we did not send a packet, disable method
debug1: Next authentication method: publickey
debug1: Trying private key: /home/Foobar/.ssh/identity
debug1: Trying private key: /home/Foobar/.ssh/id_rsa
debug1: Offering public key: /home/Foobar/.ssh/id_dsa
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-dss blen 433
debug2: input_userauth_pk_ok: fp 3f:4a:64: . . .
debug1: PEM_read_PrivateKey failed
. . .
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password,keyboard-interactive).
lost connection
16 Vivek Gite 05.27.09 at 6:58 pm

Make sure your remote ~/.ssh/authorized_keys or ~/.ssh/authorized_keys2 file is in correct format and there is no additional string attached / appended after a public key (except another public key).

17 Paul Beyer 06.18.09 at 5:07 pm

@ Milan:

I had the same problem but was able to rectify it by adding option -i to my scp command and pointing it to my user’s identify file like so:

scp -B -i /home/my_user filename_to_transfer.txt my_user@remote.host:

I think that without specifying my_user’s identify file, it default’s to the cron user’s which would could an authentication failure.

Hope this helps.

18 Milan 06.18.09 at 6:27 pm

Paul,

Thanks for the suggestion, which I’m guessing just might do the trick. I think I tried using -B without luck but I didn’t try -i. Coincidentally, I finally resolved the impasse just yesterday by giving up on DSA and switching to RSA authentication! Thanks again for the very relevant help.

19 Brian A 07.16.09 at 8:17 pm

I have followed these steps to the letter, and I am still getting these errors:

satwasdev01[/home/mvnuser/.ssh]$ ssh -vvv -i /home/mvnuser/.ssh/id_dsa.pub ic>
OpenSSH_4.6p1 (CentrifyDC build 3.0.7-745), OpenSSL 0.9.8e (CentrifyDC build 3.0.7-745) 23 Feb 2007
debug1: Reading configuration data /etc/centrifydc/ssh/ssh_config
debug1: Applying options for *
debug3: RNG is ready, skipping seeding
debug2: ssh_connect: needpriv 0
debug1: Connecting to icosqas2 [10.9.245.67] port 22.
debug1: Connection established.
debug3: Not a RSA1 key file /home/mvnuser/.ssh/id_dsa.pub.
debug1: identity file /home/mvnuser/.ssh/id_dsa.pub type 2
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.6
debug1: match: OpenSSH_4.6 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug2: fd 3 setting O_NONBLOCK
debug1: Miscellaneous failure
No credentials cache found

debug1: Miscellaneous failure
No credentials cache found

debug3: RNG is ready, skipping seeding
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: gss-gex-sha1-toWM5Slw5Ew8Mqkay+al2g==,gss-group1-sha1-toWM5Slw5Ew8Mqkay+al2g==,gss-group14-sha1-toWM5Slw5Ew8Mqkay+al2g==,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_init: found hmac-md5
debug1: kex: server->client aes128-cbc hmac-md5 none
debug2: mac_init: found hmac-md5
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 138/256
debug2: bits set: 492/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: filename /home/mvnuser/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug3: check_host_in_hostfile: filename /home/mvnuser/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug1: Host 'icosqas2' is known and matches the RSA host key.
debug1: Found key in /home/mvnuser/.ssh/known_hosts:1
debug2: bits set: 482/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/mvnuser/.ssh/id_dsa.pub (2005c358)
debug3: input_userauth_banner
This is a protected computer system. Unauthorized access is prohibited. This computer system including all related equipment, networks, and network devices is provide only for authorized Harland Clarke use.  Harland Clarke computer systems may be monitored for lawfull purposes, including approved Harland Clarke security testing.  Use of this Harland Clarke computer system authorized or unauthorized constitutes consent to monitoring of this system. Unauthorized use may subject you to criminal prosecution.
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic,password
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup gssapi-keyex
debug3: remaining preferred: gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-keyex
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug2: we did not send a packet, disable method
debug3: authmethod_lookup gssapi-with-mic
debug3: remaining preferred: publickey,keyboard-interactive,password
debug3: authmethod_is_enabled gssapi-with-mic
debug1: Next authentication method: gssapi-with-mic
debug1: Miscellaneous failure
No credentials cache found

debug1: Miscellaneous failure
No credentials cache found

debug2: we did not send a packet, disable method
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/mvnuser/.ssh/id_dsa.pub
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
mvnuser@icosqas2's password:

Please help!!

20 arun 07.22.09 at 5:24 pm

I installed OpenSSH on my windows PC (jerry here).
I have a unix box (tom here).
I’ve done all the steps mentioned here.
But when i’m trying to sftp from the unix box to the Windows PC, it is again asking for password.
Is this because the remote server is a windows pc with openSSH installed on it?
Kindly help.

21 biswa 07.29.09 at 11:44 am

I trying to login from a solaris box(local machine : daytona) to solaris box(remote machine : voltest).
my username in daytona : bpadhy
i tried to login to the voltest using the below command
sftp beaadm@10.188.45.136
but it still asks for password.

Can anyone help me in this regard.

22 Neetu 08.17.09 at 12:40 pm

Hi, I followed the exact steps and in the same session I was able to do a password less login. But when I opened a new session, I couldnt do it until I again typed:
$ exec /usr/bin/ssh-agent $SHELL
$ ssh-add

Do I need to type this in every new session? If yes, then it doesnt serve the purpose.

23 Vivek Gite 08.17.09 at 2:26 pm

@Neetu, use keycahin.

24 German M 09.03.09 at 7:53 pm

Excelent tip, thanks!

25 Bubnoff 09.24.09 at 7:37 pm

It should be pointed out that the tutorial, as is, will NOT work with backup scripts which
is probably the primary reason many of us came to this link. This will allow you to log in
during a session without a password.

There needs to be clear instructions on scripting and backups using keys for this tutorial
to ROCK. Great information and I don’t mean to be course or an ungrateful bastard, this is a great site …however. Do we need keychain for this functionality? I hope the answer is no because keychain is a PITA.

Thanks ~

Bub

26 Dhananjay 10.06.09 at 12:35 pm

Hi I have two machine from machine 1 Ima trying to do password less ssh to machine 2, generated a dsa key on machine 1 user/.ssh folder. I got private and publick dsa keys there. copied the content of pub key file and paste it to machine2 user/.ssh folder authorized_key file in the end.
but now when trying to login from machine 1 to machine 2 it asks for password, verbose mode gives below in short.

debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /var/smarthkp/.ssh/id_dsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive
debug1: Offering public key: /var/smarthkp/.ssh/id_dsa_s3c
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive
debug1: Trying private key: /var/smarthkp/.ssh/identity
debug3: no such identity: /var/smarthkp/.ssh/identity
debug1: Trying private key: /var/smarthkp/.ssh/id_rsa
debug3: no such identity: /var/smarthkp/.ssh/id_rsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 1
Password:

Please help….

27 Zack 01.20.10 at 7:50 am

I followed the procedure and its perfect.
I have another question.
Requirements: I want to assign my root account with a DSA key so that only with that specific DSA
can use the root account
How can I achieve this?

Thanks

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous FAQ:

Next FAQ:

nixCraft FAQ PDF Collection Now Available To All