正确处理方法
sudo gedit /etc/ssh/sshd_config
把 PermitRootLogin Prohibit-password 改为 PermitRootLogin yes
删除掉#符号
/etc/init.d/ssh restart
Ok !!!
我想说:@*(#&!@(*#&@!%!@%!@#
以下可能全是废话
我的Ubuntu(非虚拟机)是18.04版本的,用的国内源是阿里源(划重点!!)
前几日用我的主力机下载Xshell进行操作,发现尽管知道ip地址,但是一直连接不上
调试了各种参数都无法连接,最后回归最开始的起点 ,进行了如下操作,关闭防火墙
service sshd start
service iptables stop
重点来了!!!!
//阿里源用的防火墙不是iptables !!!!!用的是firewalld
更改: Ubuntu内置UFW (Uncomplicated Firewall)作为防火墙管理工具。。。
查看防火墙状态 : 不活动
sudo ufw status
我这边卸载了iptables ,用firewalld来做防火墙-
查看防火墙状态
systemctl status firewalld
关闭防火墙服务/软件:
systemctl stop firewalld
(没有结果就是最好的结果,说明该命令执行成功了)
再次查看防火墙状态
systemctl status firewalld
尝试连接Xshell 6
不行
!!!关闭系统自带的selinux(查看状态)
getenforce
Command 'getenforce' not found, but can be installed with:
sudo apt install selinux-utils
我透!!!喵的
按照指示
sudo apt install selinux-utils
然后
getenforce
Disabled
好像就是关着的
重点来了:我回头看,发现Xshell在连接虚拟机时要求同一网段
首先获取网卡属性
ifconfig -a
enp3s0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
为enp3s0
修改静态IP到动态IP(新手,用gedit,轻喷)
sudo gedit /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopbackauto enp3s0
iface enp3s0 inet dhcpaddress : 自己的IP地址
netmask : 自己的网关
gateway : 自己的gateway
详细的看 https://blog.youkuaiyun.com/qq_36937342/article/details/80876385