Xshell连接Ubuntu连接失败的问题

原文链接: https://my.oschina.net/u/3193075/blog/3096175

描述

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

转载于:https://my.oschina.net/u/3193075/blog/3096175

你可能感兴趣的:(Xshell连接Ubuntu连接失败的问题)