Xshell初次连接Ubuntu时失败的解决方法

基于VirtualBox

1、ifconfig查看Ubuntu的ip时显示10.0.2.1

  • ifconfig安装
apt-get install ifconfig
  • 打开 控制>设置>网络,将连接方式改为桥接网卡
其他默认(混杂模式可以改为拒绝)
此时查看ip就会显示192.168.43.xxx

2、连接root用户时显示拒绝了您的密码

  • 关闭防火墙
ufw disable  
  • 开启22端口
ufw allow 22
  • 安装ssh服务
apt-get install openssh-server

以上三步的原文链接
https://blog.csdn.net/qq_33722172/article/details/86591275

  • 更改配置文件
 vi /etc/ssh/sshd_config
将PermitRootLogin prohibit-password改为PermitRootLogin yes

不要忘记去掉PermitRootLogin属性前面的#,此属性为默认配置

  • 重启ssh服务
service ssh restart
发布了39 篇原创文章 · 获赞 47 · 访问量 4907

猜你喜欢

转载自blog.csdn.net/qq_42520112/article/details/100262227