LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 11-10-2012, 07:41 AM   #1
kikinovak
Senior Member
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: Slackware, Slackware64
Posts: 1,408

Rep: Reputation: 629Reputation: 629Reputation: 629Reputation: 629Reputation: 629Reputation: 629
Use the same SSH key on a remote host with various ghosted installations ?


Hi,

In my office I have two sandbox PC which I use extensively for testing. These machines have various installs, which are all backed up on a local FTP server using G4L (Ghost4Linux). For example:
  • Slackware 14.0 vanilla
  • Slackware 14.0 server (with Squid, SquidGuard, configured Samba, ...)
  • Slackware 14.0 desktop (custom Xfce)
  • RHEL 5.8
  • Windows XP (mainly for testing Samba file and print server)

One small problem that's nagging me is that everytime I change the install on a machine by downloading a different image from the ghost server, I get the usual someone-is-doing-something-nasty warning from SSH, as is to be expected. So I open ~/.ssh/known_hosts on my main PC, delete the relevant line with the offending key, and then I can go on with my work.

Now I know how to generate keys to be able to do passwordless logins to various remote hosts. What I don't know can only be described as: how do I go about it the other way around? Meaning how can I tweak my three different Slackware and one RHEL installs so I can log into them using SSH using the same key on my main workhorse PC? (Security is no concern here, as these are only local sandbox machines...)

When Slackware starts up the first time after installation, there's a message about "generating SSH keys". Now I think all I have to do is find the relevant files where these are stored and then replace them all by the same file or set of files. Any idea how I have to go about this?

Cheers,

Niki
 
Old 11-10-2012, 11:12 AM   #2
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.0
Posts: 3,251

Rep: Reputation: 481Reputation: 481Reputation: 481Reputation: 481Reputation: 481
For each user, the public and private keys are stored in $HOME/.ssh. Copy the public key from the client machine to $HOME/.ssh/authorized_keys on the host machine. Also add the client machine to $HOME/.ssh/known_hosts.
 
Old 11-10-2012, 12:31 PM   #3
Petri Kaukasoina
Member
 
Registered: Mar 2007
Posts: 241

Rep: Reputation: 86
Quote:
Originally Posted by kikinovak View Post
When Slackware starts up the first time after installation, there's a message about "generating SSH keys". Now I think all I have to do is find the relevant files where these are stored and then replace them all by the same file or set of files.
Code:
ls -l /etc/ssh/ssh_host_*key*
 
1 members found this post helpful.
Old 11-11-2012, 11:24 AM   #4
kikinovak
Senior Member
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: Slackware, Slackware64
Posts: 1,408

Original Poster
Rep: Reputation: 629Reputation: 629Reputation: 629Reputation: 629Reputation: 629Reputation: 629
Quote:
Originally Posted by Petri Kaukasoina View Post
Code:
ls -l /etc/ssh/ssh_host_*key*
Thanks very much, that worked! I copied over this bunch of files from my initial installation to the other ghosted systems, and now I can ssh into every single one of them without always having to recreate a new key.

Cheers,

Niki
 
  


Reply

Tags
ssh


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't SSH to remote machine: Connection closed by remote host Avatar Linux - Networking 34 05-24-2013 09:28 AM
[SOLVED] ssh host key problem Amaranthus Linux - Newbie 7 12-15-2009 03:42 PM
Fedora 10/unable to ssh out from box to remote host (SSH within LAN ok) huskeypm Linux - Networking 3 04-14-2009 07:37 PM
Remote: Your host is not permitted to use this key for login. m2azer Linux - Security 1 02-20-2008 02:31 PM
ssh Host Key ziox Linux - Networking 6 02-07-2005 02:57 PM


All times are GMT -5. The time now is 05:08 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration