|
SELinux 리눅스를 설치하고 나서 멀쩡하던 ssh가 안되는 것이다.
리부팅을 하고나서 다시 실행해본결과 이런 메시지가 떴다.
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Disabling protocol version2. Could not load host key
sshd : no hostkeys available --exiting
구글링을 한 결과.. host key가 생성되지 않아서 그렇다는 것이다.
그러나!! /etc/ssh/ssh_host_rsa_key, /etc/ssh/ssh_host_dsa_key 키가 버젓이 있음에도 불구하고
로딩을 할수 없다는건 말이 안되는 것이었다. 그래도 혹시나 하는 마음에 키젠 명령어를 실행하였다.
# /usr/local/bin/ssh-keygen -d -f /usr/local/etc/ssh_host_dsa_key -N ""
Generating public/private dsa key pair.
/etc/ssh/ssh_host_dsa_key aleady exists.
Overwrite (y/n)? y
Your identification has been saved in /usr/local/etc/ssh_host_dsa_key.
Your public key has been saved in /usr/local/etc/ssh_host_dsa_key.pub.
The key fingerprint is: 00:91:f5:8a:55:7c:ac:ff:b7:08:1f:ce:23:aa:f2:79 root@solaris8
사실 정말 키가 있었기때문에 위와같이 덮어 쓸꺼냐고 묻는다. 당연히 Yes로 대답하면 새로운 키를
생성한다. 그리고 다시 sshd 를 시작하면 좀 다른 메시지가 나온다.
Starting sshd [OK]
Could not load host key: /etc/ssh/ssh_host_rsa_key
이미 앞에서 dsa 키를 생성했으므로 그와 같은 방법으로 rsa 키도 생성해준다.
그리고 나서 sshd을 다시 시작하면 정상 작동한다.
|
http://kr.blog.yahoo.com/fxpnfo/trackback/2596944/875109