温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Xshell连接Ubuntu连接失败如何解决

发布时间:2021-07-30 15:41:17 来源:亿速云 阅读:192 作者:Leah 栏目:大数据

这篇文章给大家介绍Xshell连接Ubuntu连接失败如何解决,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

描述

刚入手Ubuntu,发现各种不适。使用Xshell连接Ubuntu(装在虚拟机下18.04.3)怎么也连接不上。

排查问题

查看防火墙设置

指令

sudo ufw status

发现我的是关了防火墙的。

Ubuntu主机没有开启SSH服务

开启指令

sudo apt-get install openssh-server

安装该SSH服务后,可以连接Ubuntu系统。

更换Ubuntu的apt源为国内源

进入编辑目录

命令

sudo vim /etc/apt/sources.list
中科大

命令

deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
阿里云源

指令

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
生效命令
sudo apt-get update
sudo apt-get upgrade

docker常用命令

操作tomcat

拉取镜像

docker pull tomcat

启动tomcat

docker run --name tomcat1 -d -p 8080:8080 tomcat

查看是否启动成功

docker ps -a

操作Nginx

拉取镜像

docker pull nginx

启动Nginx

docker run --name nginx -d -p 80:80 nginx

操作mysql

拉取镜像

docker pull mysql

启动mysql

docker run --name mysql01 -e MYSQL_ROOT_PASSWORD=123456 -d -p 3306:3306 mysql

关于Xshell连接Ubuntu连接失败如何解决就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI