Xshell连接Ubuntu连接失败的问题

心不动则不痛 提交于 2020-12-06 23:05:37

描述

刚入手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

参考

https://www.cnblogs.com/yadongliang/p/8663146.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!