Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 06-09-2013, 01:53 AM   #1
Registered: Jul 2003
Location: On the Beaches of Super Sunny Southern San Clemente, California USA
Distribution: Slackware - duh!
Posts: 533
Blog Entries: 3

Rep: Reputation: 117Reputation: 117
Arrow create new keys in /etc/ssh ???

Okay, I looked in the so-called cloud forums, but that place is a ghost town, and I'm a slacker, so considering the two paradigms that:

  • The cows come home
  • it really makes no difference that this is a a cloud question anyway
I thought that I would ask here....

I just cloned about two dozen instances of a slackware -current box under VMware, and I'm concerned that they all have the same keys under /etc/ssh, so my question is this:

  1. After I change the IP in /etc/rc.d/rc.inet1.conf
  2. and the hostnames and other applicable info in /etc/HOSTNAME, /etc/resolv.conf,
  3. What do I need to do to change the keys (if anything or should I be looking somewhere elese?, in /etc/ssh/?
  4. The MAC addys are already different when I cloned the box in VMware.
  5. Are there other tasks I need to perform to make these boxes unique aside from their respective hostnames?

My understanding is that I can just delete something and all those keys will be recreated on the next boot, or perhaps there is a job that I can run to recreate the server keys...

I know not what those steps are, however.

Any help would be most appreciated. Any additional tasks I need to perform that you can fill me in on would be fanstastic.

Kindest regards,

Last edited by tallship; 06-09-2013 at 02:02 AM. Reason: maek pritty
Old 06-09-2013, 02:22 AM   #2
Registered: Jun 2011
Distribution: Slackware
Posts: 515

Rep: Reputation: 226Reputation: 226Reputation: 226
Originally Posted by tallship View Post
My understanding is that I can just delete something and all those keys will be recreated on the next boot, or perhaps there is a job that I can run to recreate the server keys...
I'm no expert in ssh, but it seems that /etc/rc.d/rc.sshd will recreate the keys if they don't exist.

The start() function in rc.sshd:

sshd_start() {
  # Create host keys if needed.
  if [ ! -r /etc/ssh/ssh_host_key ]; then
    /usr/bin/ssh-keygen -t rsa1 -f /etc/ssh/ssh_host_key -N '' 
  if [ ! -f /etc/ssh/ssh_host_dsa_key ]; then
    /usr/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
  if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
    /usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
  if [ ! -f /etc/ssh/ssh_host_ecdsa_key ]; then
    /usr/bin/ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ''


cloning, cloning slackware, cloning workstations, slackware, slckawarew vmware

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
How to create multiple ssh keys swaxolez Linux - Security 2 03-19-2013 11:51 AM
How to set SSH keys on SSH server mansour Linux - Newbie 27 01-16-2011 11:44 AM
SSH host keys are not being read correctly from .ssh/known_hosts. bartonski Linux - Software 3 10-29-2009 04:40 PM
SSH host keys VS SSH keys kenneho Linux - Security 3 09-11-2008 06:03 AM
Configuring SSH to accept only keys (already have keys) fr0st Linux - Security 3 11-04-2003 03:31 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:33 PM.

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