Showing results for 
Search instead for 
Did you mean: 

ssh without password

Occasional Contributor

ssh without password


i want to login to remote server using ssh without password. For that i tried to set "ssh-keygen" but it is still asking for password. Please find steps i performed below.

ssh-keygen -t rsa
cat .ssh/ | ssh name@host_server 'cat >> .ssh/authorized_keys'

i also tried with dsa keys

from client:
ssh-keygen -t dsa -f $HOME/.ssh/id_dsa -P ''
scp $HOME/.ssh/ svm0022pdv:$HOME/.ssh/

In server:
cat >> $HOME/.ssh/authorized_keys2
cat >> $HOME/.ssh/authorized_keys

i also edit file "/etc/ssh/ssh_config".

But still getting pasword prompt whenever i do ssh to server.
I am using linux machine. Can anyone help me with detailed step to solve this problem

Kumar Nishant
Honored Contributor

Re: ssh without password

To configure ssh with passwd

Steps: For SSH Without a Password

On the client run the following commands:
$ mkdir -p $HOME/.ssh
$ chmod 0700 $HOME/.ssh
$ ssh-keygen -t dsa -f $HOME/.ssh/id_d sa -P ''

This should result in two files,
$HOME/.ssh/id_dsa (private key) & $HOME/.ssh/ (public key).
Copy $HOME/.ssh/ to the server.

On the server run the following commands:
$ mkdir -p $HOME/.ssh
$ cat >> $HOME/.ssh/authorized_keys2
$ chmod 0600 $HOME/.ssh/authorized_keys2

Depending on the version of OpenSSH the following commands may also be required:
$ cat >> $HOME/.ssh/authorized_keys
$ chmod 0600 $HOME/.ssh/authorized_keys

An alternative is to create a link from authorized_keys2 to authorized_keys:
$ cd $HOME/.ssh && ln -s authorized_keys2 authorized_keys

On the client test the results by ssh'ing to the server:
$ ssh -i $HOME/.ssh/id_dsa server

(Optional) Add the following $HOME/.ssh/config on the client:
Host server
IdentityFile ~/.ssh/id_dsa
This allows ssh access to the server without having to specify the path to the id_dsa file as an argument to ssh each time.

Honored Contributor

Re: ssh without password

> I am using linux machine.

So why ask in an HP-UX forum?

A Forum search for keywords like
ssh password
should find many old discussions on this
topic. Almost all of them will suggest using
the "-v" option in your "ssh" command. Some
of them will also suggest showing an actual
transcript of a failing command, an "ls -l"
report on your ".ssh" directory, and some
other things.

> i also edit file "/etc/ssh/ssh_config".

Uh, we can't see it, either before or after
you did whatever you did to it.
Honored Contributor

Re: ssh without password

Probably it's a file system permission problem. SSH is trict with permissions, check the permissions for the home directory and the .ssh directory and files, ensure that group and other don't have write permissions enabled.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Exalted Contributor

Re: ssh without password


Most of these problems come from ownership and permissions.

Take a look here for a guide.

Steven E Protter
Owner of ISN Corporation