ssh: connect to host localhost port 22: Connection refused : 通过系统日志排查问题
2016-08-22 14:50
791 查看
1. 配置好了ssh免登录,但登录的时候却报拒绝连接
2. 检查防火墙,防火墙已关闭
3. 查看系统日志,发现原来是配置问题
4. 改正配置文件,搞定。
[hadoop@hadoop1 Desktop]$ ssh localhost ssh: connect to host localhost port 22: Connection refused
2. 检查防火墙,防火墙已关闭
[hadoop@hadoop1 Desktop]$ systemctl status iptables.service iptables.service - IPv4 firewall with iptables Loaded: loaded (/usr/lib/systemd/system/iptables.service; disabled) Active: inactive (dead)
3. 查看系统日志,发现原来是配置问题
[hadoop@hadoop1 Desktop]$ sudo tail /var/log/messages [sudo] password for hadoop: Aug 22 02:41:54 hadoop1 systemd: fprintd.service: main process exited, code=exited, status=157/n/a Aug 22 02:41:54 hadoop1 systemd: Unit fprintd.service entered failed state. Aug 22 02:41:55 hadoop1 systemd: sshd.service holdoff time over, scheduling restart. Aug 22 02:41:55 hadoop1 systemd: Stopping OpenSSH server daemon... Aug 22 02:41:55 hadoop1 systemd: Starting OpenSSH server daemon... Aug 22 02:41:55 hadoop1 systemd: Started OpenSSH server daemon. Aug 22 02:41:55 hadoop1 sshd: /etc/ssh/sshd_config: line 158: Bad configuration option: sshd:All Aug 22 02:41:55 hadoop1 sshd: /etc/ssh/sshd_config: terminating, 1 bad configuration options Aug 22 02:41:55 hadoop1 systemd: sshd.service: main process exited, code=exited, status=255/n/a Aug 22 02:41:55 hadoop1 systemd: Unit sshd.service entered failed state. [hadoop@hadoop1 Desktop]$
4. 改正配置文件,搞定。
/etc/ssh/sshd_config
相关文章推荐
- ssh: connect to host localhost port 22: Connection refused 问题
- 在ubuntu中配置SSH(解决connect to host localhost port 22: Connection refused问题)
- ssh: connect to host localhost port 22: Connection refused 问题
- hadoop localhost:ssh:connect to host localhost port 22:Connection refused问题
- 防火墙安装ssh: connect to host localhost port 22: Connection refused 问题
- 在ubuntu中配置SSH(解决connect to host localhost port 22: Connection refused问题)
- 在ubuntu中配置SSH(解决connect to host localhost port 22: Connection refused问题)
- ssh: connect to host localhost port 22: Connection refused 问题
- Ubuntu 安装配置SSH(ssh: connect to host localhost port 22: Connection refused问题的解决)
- ssh: connect to host localhost port 22: Connection refused 问题
- 在Ubuntu中配置SSH(解决connect to host localhost port 22: Connection refused问题)
- Ubuntu 安装配置SSH(ssh: connect to host localhost port 22: Connection refused问题的解决)
- ssh: connect to host localhost port 22: Connection refused 问题
- 在ubuntu中配置SSH(解决connect to host localhost port 22: Connection refused问题)
- ssh:connect to host localhost port 22: Connection refused解决方法
- ssh: connect to host localhost port 22: Connection refused(ubuntu14.04_LTS)
- ssh: connect to host localhost port 22: Connection refused
- 解决connect to host localhost port 22: Connection refused问题
- ssh: connect to host localhost port 22: Connection refused (3)
- ssh: connect to host localhost port 22: Connection refused (2)