Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSH Keys 1

Status
Not open for further replies.

Momozone

IS-IT--Management
Dec 2, 2004
103
0
0
IE
I wanted to create an SSH key that will only allow clients with that key connect but will not give the client the option to install that key if they ssh to that box.

For security reasons.

Thanks in advance!

MoMoZoNe
 
Ok,

here is what you do,

Code:
ssh-keygen -t rsa

this will generate a private/public pair of keys with the name you will choose or standard name is_rsa, id_rsa.pub
You will find them in the .ssh durectory, subdirectory of
the user's home (i.e. /root/ or /home/username)

Example:
To register the public key for the user john, login as john and run the above command then
Code:
cat /home/john/.ssh/your_public_key_file.pub >> /home/john/.ssh/authorized_keys

Create the file authorized_keys if it doe not exists.

Now, on each client from which the user john has to have access enable ssh-agent

Code:
ssh-agent /bin/bash/

then import the private key

Code:
ssh-add your_private_key_file

CHeers

QatQat



Life is what happens when you are making other plans.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top