SSH without inputing password

Johan Booysen johan at matrix-data.co.uk
Wed May 21 07:54:05 UTC 2008


This works for me on RHEL5:

On the client:

1. Generate a private/public keypair with an empty password:

$ pwd
   /home/username

$ ssh-keygen -t dsa

2. Copy the generated public key to the server:

$ scp .ssh/id_dsa.pub username at servername:/home/username


On the server:

1. Rename the public key:

$ mv id_dsa.pub authorized_keys

2. Copy the authorized_keys file to the user's .ssh directory.  If the
.ssh directory does not exist, create it and modify its permissions as
follows:

$ mkdir .ssh
$ chown 700 .ssh/

$ mv authorized_keys .ssh/

3. Check that the authorized_keys file has the following permissions:

$ -rw-r--r-- 1 username username  599 Mar 21 10:55 authorized_keys


4. From the client, log on to the server.  You should not be prompted
for a password.



-----Original Message-----
From: redhat-list-bounces at redhat.com
[mailto:redhat-list-bounces at redhat.com] On Behalf Of Sanjay Chakraborty
Sent: 21 May 2008 01:11
To: General Red Hat Linux discussion list
Subject: Re: SSH without inputing password

Hi there,
One other thing do not change the permission level for authorized_keys
file
and .ssh key directory.


On Tue, May 20, 2008 at 1:19 PM, aydin sasmaz <sasmaz at itu.edu.tr> wrote:

> Hi
>
> Have you tried this method before or is suitable for you
>
> 1) generating a rsa or dsa key pair o a local host,
> 2) concatenate id_rsa.pub or id_dsa.pub to the
/root/.ssh/authorized_keys
> or
> authorized_keys2 file on the remote host
>
> After that you can easily ssh from local to remote host without
password
> issue
>
>
> Regards
>
>
>
> -----Original Message-----
> From: redhat-list-bounces at redhat.com [mailto:
> redhat-list-bounces at redhat.com]
> On Behalf Of Daniel Carrillo
> Sent: Tuesday, May 20, 2008 5:34 PM
> To: General Red Hat Linux discussion list
> Subject: Re: SSH without inputing password
>
> 2008/5/20 tech user <techwww at yahoo.com.cn>:
> >
> > But what I wanted is:
> >
> > 1> ssh remote_host
> > 2> input password automatically for me
> > 3> let me login into it successfully and stay there
> >
> > Do you know me? Thank you.
> >
> > --Ken
> >
>
> Hi.
>
> You can make a simple perl wrapper using Net::SSH::Perl (see
$ssh->shell).
>
> Cheers.
>
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>
> --
> redhat-list mailing list
> unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/redhat-list
>



-- 

Regards.
Sanjay Chakraborty
-- 

redhat-list mailing list
unsubscribe mailto:redhat-list-request at redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list




More information about the redhat-list mailing list