ssh without password
Jonathan S. Romero
jromero at raydiance-inc.com
Fri Oct 14 19:23:38 UTC 2005
On the host machine (the one you are connecting to)
--------------------------------------------------
/etc/ssh/sshd_config has a line that describes what the location and
name of the authorized keys files is. Note that the default is to use a
per-user authorized_keys file in the .ssh subdirectory of their home
folder.
Running ssh-keygen -t dsa will create that folder and give you a default
key for that user. Note that you probably dont need to set a password
on the key, just leave it blank. This is neccessary if you want to use
that key for cron scripts.
On the guest machine(the one you are connecting from)
------------------------------------------------------
Create the key, if you havent already:
ssh-keygen -t dsa
#Enter no password for the key when asked. And store in the default
location.
scp .ssh/id_dsa.pub root at hostmachine:/root/
ssh root at hostmachine
#now we're on the host machine
cat id_dsa.pub >> .ssh/authorized_keys
chown root:root .ssh/authorized_keys
chmod 644 .ssh/authorized_keys
exit
#Now we're back on the guest machine, do an ssh login with
#verbose logging enabled. This will tell you if the security step
#succeeds.
ssh -v root at hostnmachine
If you still have problems, watch the ssh log on the host machine.
#on the host machine
tail -f /var/log/auth.log
Enjoy!
On Sat, 2005-10-15 at 00:24 +0530, shamsheer yousaf wrote:
> Try renaming the file on the server to authorized_keys2 .
> Also another problem could be the permissions of the file
> authorized_keys2 . It should ideally have the permission bits set to
> 0644 .........maybe that could be the problem ...
>
> Regards
> Shamsheer
>
> On 10/14/05, Reinhard Tartler <siretart at gmail.com> wrote:
> On 10/14/05, David <david at kenpro.com.au> wrote:
> > I'm trying to use dsa key pairs so that I can ssh in a cron
> script without
> > passwords. I've generated the key pair, then copied the
> public key to the
> > server. Client is Hoary, and server is Debian Sarge.
> >
> > When I ssh, I get asked for a password. Is there some step
> I'm missing? Is
> > there something in the sshd_config or ssh_config that needs
> fixing?
>
> A less obvious reason for this behaviour could be wrong
> permissions of
> your home directory on the remote side. Try on the remote site
> checking /var/log/auth.log and /var/log/damon.log. Sshd should
> give
> you some diagnostics in this case.
>
> --
> regards,
> Reinhard
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> http://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
>
>
> --
> "Never let your sense of morals prevent you from doing what is
> right!"
> - "Salvor Hardin , Foundation " , Isaac Asimov
More information about the ubuntu-users
mailing list