Ubuntu如果没有安装ssh的server,需要安装
apt-get install openssh-server
ssh客户端是默认安装的,连接其它ssh服务器用的,使用 apt install openssh-client安装
安装ssh服务后,系统默认开启系统sshd,查看sshd状态如果不是默认启动,修改服务为enable
sudo systemctl status ssh
sudo systemctl enable ssh
修改/etc/ssh/sshd_config文件
vim /etc/ssh/sshd_config
修改如下:允许root账户登录
#PermitRootLogin prohibit-password
PermitRootLogin yes
需要重启系统或者sshd服务
sudo /etc/init.d/ssh stop
sudo /etc/init.d/ssh start
sudo service ssh restart
yum list installed |grep openssh-server
如果有输出,证明已经安装了openssh-server,如果没有,需要安装
yum install openssh-server
vim /etc/ssh/sshd_config #没有vim用vi或者yum install -y vim 安装
Port 22
ListenAddress 0.0.0.0
ListenAddress ::
PermitRootLogin yes
PasswordAuthentication yes
service sshd start
service sshd restart
systemctl enable sshd