LinuxQuestions.org
Help answer threads with 0 replies.
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
 
Search this Thread
Old 11-10-2012, 08:41 AM   #1
kikinovak
Senior Member
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: Slackware, Slackware64
Posts: 1,949

Rep: Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972
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, 12:12 PM   #2
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
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, 01:31 PM   #3
Petri Kaukasoina
Member
 
Registered: Mar 2007
Posts: 242

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, 12:24 PM   #4
kikinovak
Senior Member
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: Slackware, Slackware64
Posts: 1,949

Original Poster
Rep: Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972Reputation: 972
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


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 10:28 AM
[SOLVED] ssh host key problem Amaranthus Linux - Newbie 7 12-15-2009 04:42 PM
Fedora 10/unable to ssh out from box to remote host (SSH within LAN ok) huskeypm Linux - Networking 3 04-14-2009 08:37 PM
Remote: Your host is not permitted to use this key for login. m2azer Linux - Security 1 02-20-2008 03:31 PM
ssh Host Key ziox Linux - Networking 6 02-07-2005 03:57 PM


All times are GMT -5. The time now is 12:29 PM.

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