# sshd

## meekj

Hello. I would like to setup sshd to run at startup. How do I do this? I also need to generate RSA keys it times me when I run "sshd" manualy. Thank you.

----------

## klieber

 *meekj wrote:*   

> Hello. I would like to setup sshd to run at startup

 

as root, rc-update add ssh default  (might be sshd instead of ssh -- not sure)

 *Quote:*   

> I also need to generate RSA keys it times me when I run "sshd" manualy. Thank you.

 

Not sure I understand this question -- sshd should generate keys automatically when you start it if it needs to.

--kurt

----------

## Nitro

 *meekj wrote:*   

> I also need to generate RSA keys it times me when I run "sshd" manualy. Thank you.

 

What you are looking for is 'ssh-keygen'

```
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key

ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
```

Also, make sure that you only run the sshd under protocol two, there was an exploit for protocol one out a while ago, and I don't see much of a need to use it anymore. That means on a line in you sshd_config you should have just: 'Protocol 2'

For more information about the exploit I mentioned visit: http://www.kb.cert.org/vuls/id/945216

Hope this helps  :Smile: 

----------

