LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-12-2007, 06:27 PM   #1
Firebar
Member
 
Registered: Feb 2005
Location: Southampton (UK)
Distribution: Debian, RHEL and SuSE
Posts: 69

Rep: Reputation: 15
ssh - managing keys


Hi all,

Quite an easy one. I have 2 servers and would like to have a public key for each of them (same user though). So on my box I ran as the user;

ssh-keygen -t dsa

copied the public key over to the server and put into authorized_keys, all works fine.

How do I manage 2 keys on the local machine (not the server)? I understand I could make a new key, copy the .pub over to the 2nd server and create a new authorized_keys file, but how do I store multiple keys on my personal machine?

So, quite simply really but I'm missing the plot somewhere

Thanks.
 
Old 04-12-2007, 08:13 PM   #2
cgjones
Member
 
Registered: Nov 2005
Location: Central New York
Distribution: Ubuntu
Posts: 405

Rep: Reputation: 31
I'm not quite sure I understand what you are trying to do, so bear with me.

You have 2 servers and a workstation?

If the above is true, is there a specific reason you want a unique key for each server?
 
Old 04-12-2007, 09:40 PM   #3
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,781

Rep: Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081Reputation: 2081
You can use ~/.ssh/config to specify different options for different hosts:
Code:
#Host directive makes following directives only apply to that host, it
#checks the based on the name given on the command line, can use * and
#? wildcards
Host host1
IdentityFile ~/.ssh/id_dsa1

Host host2
IdentityFile ~/.ssh/id_dsa2
man ssh_config for more details

Last edited by ntubski; 04-12-2007 at 09:49 PM.
 
Old 04-13-2007, 09:33 AM   #4
Firebar
Member
 
Registered: Feb 2005
Location: Southampton (UK)
Distribution: Debian, RHEL and SuSE
Posts: 69

Original Poster
Rep: Reputation: 15
Quote:
If the above is true, is there a specific reason you want a unique key for each server?
I was just wondering if it were possible. I should know better than to delve into the man pages

Thanks for your input guys, I'll take a look at it now.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh keys sachin1361 Linux - Enterprise 9 03-12-2007 05:18 PM
RpmDrake - managing keys giri2 Mandriva 1 08-30-2004 08:25 PM
Configuring SSH to accept only keys (already have keys) fr0st Linux - Security 3 11-04-2003 03:31 AM
managing pseudo terminals in an ssh session kirkhamster1 Linux - Newbie 1 10-08-2003 12:26 AM
SSh Keys shaggz Linux - General 2 02-19-2003 09:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 02:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration