公司辦公網絡從192.168.1.* 換成了 172.221.19.*,但是機房服務器還是用原來的192.168.1.*。出現的問題是ssh登錄不上,SecureCRT也連不上,但是互相是可以ping通的。
提交代碼到倉庫,git push 報錯:ssh_exchange_identification: read: Connection reset by peer fatal: Could not read from remote repository。重新生成密鑰:ssh-keygen -t rsa -C '[email protected]',配置到gitlab後也不起作用。
解決:
1.登錄服務器,
vim /etc/hosts.allow
在hosts.allow文件最後輸入
sshd: ALL
2. 重啓ssh服務
service sshd restart
最後提交代碼成功,SecureCRT也可以正常連接了。