怎么通过ssh远程连接到红旗
xiaoxu 2022-1-8 6588

怎样才能通过ssh远程连接到红旗,需要怎样设置呢?

最新回复 (3)
  • 0 2
    确定安装ssh没有,没有就装一下openssh-server    执行一下sudo  dpkg-reconfig openssh-server
    2022-1-9 回复
  • 0 3
    finalshell
    2022-1-26 回复
  • 0 4
    不知道什么原因,红旗Linux V11默认没有创建ssh服务所需要的各种密钥文件。 

    # ls -lh /etc/ssh 
    总用量 584K
    -rw-r--r-- 1 root root 552K 1月  31  2020 moduli
    -rw-r--r-- 1 root root 1.6K 1月  31  2020 ssh_config
    -rw-r--r-- 1 root root 3.2K 1月  31  2020 sshd_config

    尽管openssh-server已经安装,并且sshd已经运行, 但用户无法用ssh远程登录红旗Linux v11机器,因为sshd服务需要本地的密钥文件存在。 日志(/var/log/auth.log)里出错信息如下:

    Mar 18 19:12:45 local-pc sshd[1699]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key
    Mar 18 19:12:45 local-pc sshd[1699]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key
    Mar 18 19:12:45 local-pc sshd[1699]: error: Could not load host key: /etc/ssh/ssh_host_ed25519_key
    Mar 18 19:12:45 local-pc sshd[1699]: fatal: No supported key exchange algorithms [preauth]

    运行 dpkg-reconfigure openssh-server 命令以后, 这些密钥文件被生成, 远程登录的问题就解决了。

    # ls -lh /etc/ssh 
    总用量 584K
    -rw-r--r-- 1 root root 552K 1月  31  2020 moduli
    -rw-r--r-- 1 root root 1.6K 1月  31  2020 ssh_config
    -rw-r--r-- 1 root root 3.2K 1月  31  2020 sshd_config
    -rw------- 1 root root  505 3月  18 19:17 ssh_host_ecdsa_key
    -rw-r--r-- 1 root root  175 3月  18 19:17 ssh_host_ecdsa_key.pub
    -rw------- 1 root root  399 3月  18 19:17 ssh_host_ed25519_key
    -rw-r--r-- 1 root root   95 3月  18 19:17 ssh_host_ed25519_key.pub
    -rw------- 1 root root 1.8K 3月  18 19:17 ssh_host_rsa_key
    -rw-r--r-- 1 root root  395 3月  18 19:17 ssh_host_rsa_key.pub
    2022-3-19 回复
返回