Ubuntu20 使用MobaXterm远程登陆,要更改ubuntu20的 sshd_config文件内容

Linux

1.安装并开启SSH

sudo apt-get install openssh-server
sudo /etc/init.d/ssh start
2.查看ubuntu地址

ifconfig


Windows

1.安装MobaXterm, 按序号顺序执行

Ubuntu 使用MobaXterm远程登陆_Ubuntu

 

使用root用户登录linux显示access denied
分析原因:一般linux系统是默认禁止远程登录root用户

解决办法:需要修改 /etc/ssh/ssh_config 配置,允许登录

1.编辑配置文件

   命令:vi /etc/ssh/sshd_config

2.文件中找到PermitRootLogin

  #PermitRootLogin without-password

  将#去掉,without-password改为yes

  PermitRootLogin yes

3.退出并保存,重启ssh

  命令:service sshd restart

    ubuntu操作openssh-server指令

    1、先停掉SSH服务:sudo stop ssh
    2、卸载openssh-server:apt-get remove openssh-server
    3、卸载openssh-client: apt-get remove openssh-client
    4、安装openssh-server:apt-get install openssh-server
    5、安装openssh-client:apt-get install openssh-client
    6、安装完成以后,启动服务:sudo /etc/init.d/ssh start  

    7、启动后,查看服务是否正确启动: ps -e|grep ssh