P2Baby 发表于 2009-04-22 12:45

Solaris上不能登陆SSH问题的解决

昨天新买的SUN T5220机器因为停电导致只能使用telnet登陆,而不能使用SSH登陆。使用SecurityCRT登录时显示Connection Refused

使用查看/etc/ssh目录下的sshd_config,配置没有异常

查看证书文件读写权限也正常,如下:
-bash-3.00$ pwd
/etc/ssh
-bash-3.00$ ls -l
total 208
-rw-r--r--   1 root   sys      88301 Jan 222005 moduli
-rw-r--r--   1 root   sys          861 Jan 222005 ssh_config
-rw-------   1 root   root         668 Mar 24 15:46 ssh_host_dsa_key
-rw-r--r--   1 root   root         603 Mar 24 15:46 ssh_host_dsa_key.pub
-rw-------   1 root   root         887 Mar 24 15:46 ssh_host_rsa_key
-rw-r--r--   1 root   root         223 Mar 24 15:46 ssh_host_rsa_key.pub
-rw-r--r--   1 root   root      5203 Mar 24 16:06 sshd_config
-rw-r--r--   1 root   sys         5202 Jan 222005 sshd_config.fcs

最后无奈只能重新生成dsa和rsa证书:
# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (//.ssh/id_rsa): /etc/ssh/ssh_host_rsa_key
/etc/ssh/ssh_host_rsa_key already exists.
Overwrite (yes/no)? yes
Enter passphrase (empty for no passphrase):"一定不能输入任何东西,直接回车"
Enter same passphrase again: "一定不能输入任何东西,直接回车"
Your identification has been saved in /etc/ssh/ssh_host_rsa_key.
Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub.
The key fingerprint is:
99:5a:94:62:2f:05:aa:36:87:b3:e2:cf:fd:1f:d4:a4 root@SUNAPSVR
RSA证书生成完毕,接下来重新生成DSA证书:
# ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (//.ssh/id_dsa): /etc/ssh/ssh_host_dsa_key
/etc/ssh/ssh_host_dsa_key already exists.
Overwrite (yes/no)? yes
Enter passphrase (empty for no passphrase):"一定不能输入任何东西,直接回车"
Enter same passphrase again: "一定不能输入任何东西,直接回车"
Your identification has been saved in /etc/ssh/ssh_host_dsa_key.
Your public key has been saved in /etc/ssh/ssh_host_dsa_key.pub.
The key fingerprint is:
0e:e6:d7:ec:39:89:2f:36:ed:51:40:c3:2e:a5:e9:c4 root@SUNAPSVR
# svcadm restart ssh

这样就能重新使用SSH登陆了
注:红色字体部分为需要交互的地方,其中SUNAPSVR是机器名

lvan6750 发表于 2009-05-12 12:47

应该与/etc/ssh/sshd_config里面的PermitRootLogin no 有关吧

leopan1983 发表于 2013-12-12 15:31

他都说没有异常了,可见应该不是那个PermitRootLogin的配置问题。
不过如果是新安装Solaris,不妨先检查一下PermitRootLogin 的值
页: [1]
查看完整版本: Solaris上不能登陆SSH问题的解决