安装OpenSSH

  • 安装ssh

pacman -Syy openssh

  • 启动服务

# systemctl start sshd

  • 开机启动

# systemctl enable --now sshd

无法登录SSH解决办法

xShell连接Linux服务器提示密码错误

  • 检查/etc/ssh/sshd_config:
  • 将#Authentication下面的5行全部反注释掉,不同的更改一下。

    1. #Authentication:
    2. LoginGraceTime 2m
    3. PermitRootLogin yes
    4. StrictModes yes
    5. MaxAuthTries 6
    6. MaxSessios 10
  • 重启Linux即可。