[转载] windows 子系统 XShell 连接配置

安装ssh

    # 卸载自带的
    sudo apt autoremove openssh-server
    # 下载
    sudo apt instrall openssh-server

配置并启动服务

配置ssh文件

    # 备份被指
    sudo cp /etc/ssh/sshd_config  /etc/ssh/sshd_config_bak
    # 进入ssh配置
    sudo vim /etc/ssh/sshd_config
    
    # 进入vim,进行于以下配置
    Port 23 # 写一个未被占用的端口
    ListenAddress 0.0.0.0 # 监控本地地址
    # StrickModes yes # 注释严格模式
    PasswordAuthentication # 允许密码登录
    
    # 保存,:wq!

重启服务

    sudo service ssh --full-restart

注意

sshd error: could not load host key

    sudo rm /etc/ssh/ssh*key
    dpkg-reconfigure openssh-server

服务不是默认启动的

手动启动

    # 查看状态
    ps -e|grep ssh
    # 启动
    sudo service ssh start

设置服务开机启动

    sudo update-rc.d ssh defaults (port)

转自:[https://blog.csdn.net/u_ascend/article/details/86010866]{https://blog.csdn.net/u_ascend/article/details/86010866}

posted @ 2019-11-13 09:23  本院长  阅读(333)  评论(0)    收藏  举报