View previous topic :: View next topic |
Author |
Message |
Mr Tom n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 22 Nov 2009 Posts: 1
|
Posted: Sun Nov 22, 2009 8:23 pm Post subject: sshd |
|
|
Hi Guys
Im new here and have a quick question
I wish for sshd to begin at startup im not sure how to do this I would like o generate rsa keys when i set sshd off on manual.
Hope someone can help as my head hurts tring to figure it out
Regards
Mr Tom |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
coRpTitan n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 21 Aug 2005 Posts: 55 Location: Czech Republic, Brno
|
Posted: Sun Nov 22, 2009 8:32 pm Post subject: |
|
|
Hello Mr Tom,
As root run rc-update add sshd default
This will add sshd service into default run level.
Regarding sshd certs: I'm not sure if I understand question properly, but this init script should generate new certificates if it can't find old one in default location(in case you newly installed sshd).
This is code of init script (/etc/init.d/sshd) which generates certs. :
Code: | gen_keys() {
if [ ! -e "${SSHD_CONFDIR}"/ssh_host_key ] ; then
einfo "Generating Hostkey..."
/usr/bin/ssh-keygen -t rsa1 -b 1024 -f "${SSHD_CONFDIR}"/ssh_host_key -N '' || return 1
fi
if [ ! -e "${SSHD_CONFDIR}"/ssh_host_dsa_key ] ; then
einfo "Generating DSA-Hostkey..."
/usr/bin/ssh-keygen -d -f "${SSHD_CONFDIR}"/ssh_host_dsa_key -N '' || return 1
fi
if [ ! -e "${SSHD_CONFDIR}"/ssh_host_rsa_key ] ; then
einfo "Generating RSA-Hostkey..."
/usr/bin/ssh-keygen -t rsa -f "${SSHD_CONFDIR}"/ssh_host_rsa_key -N '' || return 1
fi
return 0
}
|
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
xtz Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/gallery/Star Wars/movie_star_wars_darth_vader.gif)
Joined: 29 Oct 2007 Posts: 181 Location: Singapore
|
Posted: Mon Nov 23, 2009 4:08 pm Post subject: Re: sshd |
|
|
Mr Tom wrote: | ...
I wish for sshd to begin at startup im not sure how to do this I would like o generate rsa keys when i set sshd off on manual.
... | From what I get - you want sshd to remove the existing certificates, when you turn it off? You can modify the function, thats stops sshd in the init script to remove the existing certificates, but this will happen everytime you turn off sshd (even during reboot, or restarting as a dependent service), which is probably not what you want to do, as you said "set sshd off ot manual". Or you can write another script for you, based on that function, so when you want to manually stop sshd and remove the certificates - you can use it. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|