Sunday, February 3, 2013

how to do SSH-KEYGEN RHEL and HP UX

Hi Friends,

A new thing i have learnt today, which is in RHEL. It is to generate ssh-keygen. Which we used to do passowrd less authentication. here what happens at backend, the file authorized_keys in local dir of user in .ssh/authorized_keys. it copies the encrypted password of a user into another server.
It requires only one time passsword and after this a user doesn;t need a passowrd to login into the server with which encrypted file is shared.

# or $ or any user can generate ssh-keygen

#ssh-keygen -t rsa

it will generate a key for root user as i am on root.

now a quick way to sent the file to another node is in LINUX.

#ssh-copy-id node1 ;------------ it is being done from node2 for example.

enter the password for once and then it will login and then exit and then login.

Now you will not need to enter the passsword.

HP UX :-

ofcourse, Yes User has to be there eg. sanjay

$ ssh sanjay@node1 mkdir -p .ssh

The authenticity of host 'node1 (node1)' can't be established.

RSA key fingerprint is fd:a0:7d:04:e7:ee:b1:d5:7a:fd:31:34:d9:0c:b3:89.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added 'node1' (RSA) to the list of known hosts.



$ cat .ssh/|ssh sanjay@node1 'cat >> .ssh/authorized_keys'






Last successful login:       Tue Aug 23 19:05:27 2011

(c)Copyright 1983-2006 Hewlett-Packard Development Company, L.P.

(c)Copyright 1979, 1980, 1983, 1985-1993 The Regents of the Univ. of California

(c)Copyright 1980, 1984, 1986 Novell, Inc.

(c)Copyright 1986-2000 Sun Microsystems, Inc.

(c)Copyright 1985, 1986, 1988 Massachusetts Institute of Technology

(c)Copyright 1989-1993  The Open Software Foundation, Inc.

(c)Copyright 1990 Motorola, Inc.

(c)Copyright 1990, 1991, 1992 Cornell University

(c)Copyright 1989-1991 The University of Maryland

(c)Copyright 1988 Carnegie Mellon University

(c)Copyright 1991-2006 Mentat Inc.

(c)Copyright 1996 Morning Star Technologies, Inc.

(c)Copyright 1996 Progressive Systems, Inc.

Now you are done.
Love Sharing
Amit Chopra

No comments: