juniper-SRX FW ssh登录被拒绝问题
作者:互联网
问题:
今天SSH登录一台SRX防火墙,发现登录被拒绝,有如下信息。console检查SSH是配置正常的。
[BEGIN] 2021/3/23 15:25:35
Connecting to 192.168.100.101:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
Connection closing...Socket close.
Connection closed by foreign host.
[END] 2021/3/23 15:25:35
查找分析:
- 确认防火墙 ssh 配置正确。尝试删除ssh配置,重新配置没有解决。
- juniper网站搜素了一下相关关键字,发现有和我遇到类似的问题。思路是SSH certificate导致的。
解决:
- 按照网站上的方法尝试了一下,没有解决。
- 可能由于juniper 设备型号不一致导致的一些目录也不一样。
- 找了机房同类型的一台设备,查看了一下ssh的文件位置。
- root账户进入shell 操作,操作步骤如下。
- 再次SSH进入设备,解决!
HKGE-SRXHHH> start shell user root
root@HKGE-SRXHHH% mkdir ssh
root@HKGE-SRXHHH% cd ssh
root@HKGE-SRXHHH% pwd
/cf/var/db/ssh
root@HKGE-SRXHHH% ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
Generating public/private rsa key pair.
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:
0f:50:6e:fe:a2:01:4b:5d:fc:c0:d2:b6:91:9f:3c:73 root@HKGE-SRXHHH
The key's randomart image is:
+--[ RSA 2048]----+
| . |
| * . |
| o % |
| . B B . |
| o . S B E |
| . o + + |
| . . . o |
| o . |
| . |
+-----------------+
root@HKGE-SRXHHH%
root@HKGE-SRXHHH% pwd
/cf/var/db/ssh
总结:
- 非常开心解决,之前基本准备放弃,等着重启设备看看。
- 对juniper SRX 防火墙有了进一步的思考。原来防火墙底层是这样工作的。
标签:SRXHHH%,juniper,FW,rsa,host,ssh,key,HKGE 来源: https://blog.51cto.com/jsahz/2669685