返回> 网站首页 

Ubuntu下root用户配置ssh和sftp服务

yoours2023-03-10 21:38:15 阅读 1307

简介一边听听音乐,一边写写文章。

一、安装ssh服务

    sudo apt install openssh-server

    sudo service ssh start


二、配置

    vim /etc/ssh/sshd_config

    修改如下设置:

    Port 22 //打开22端口(此处可以自定义,默认22)

    # 找到下面这行并注释掉

    # Subsystem sftp /usr/libexec/openssh/sftp-server

    # 后面加入

    Subsystem sftp internal-sftp //打开sftp


    # 找到下面这行并注释掉

    PermitRootLogin no

    # 修改为:

    PermitRootLogin yes //允许root账户登录,一般来说,为了安全起见,这一段还是不要允许的好.不过安全要求不高,可以这样做


    # 找到下面这行并注释掉

    #PermitEmptyPasswords no

    # 修改为

    PermitEmptyPasswords no //这段的意思是,使得允许空密码成为不可用,换句话说就是,不允许空密码登陆.


    # 找到下面这行并注释掉

    PasswordAuthentication no

    # 修改为:

    PasswordAuthentication yes //允许ssh账户使用密码验证登陆

三、重启sshd服务

systemctl restart sshd


四、安装客户端

    https://winscp.net/

    https://putty.org/


微信小程序扫码登陆

文章评论

1307人参与,0条评论