scp 丢失连接并超时错误 linux

scp 丢失连接并超时错误 linux

我是 Linux 新手,想在scp两台 Linux 服务器之间通过 scp 进行文件传输。我已经为两台服务器安装了 SSH,而且可以正常工作。我还启用了 PasswordAuthentication,但没有结果。

scp codesgcc.txt user@ip:/home/
ssh: connect to host ip port 22: Connection timed out
lost connection

当我尝试service sshd status检查 SSH 是否工作时:

ssh.service - OpenBSD Secure Shell server
     Loaded: loaded (/lib/systemd/system/ssh.service; disabled; vendor preset: enabled)
     Active: active (running) since Sun 2023-06-11 10:48:37 EEST; 13h ago
       Docs: man:sshd(8)
             man:sshd_config(5)
   Main PID: 23254 (sshd)
      Tasks: 1 (limit: 9320)
     Memory: 2.3M
        CPU: 126ms
     CGroup: /system.slice/ssh.service
             └─23254 "sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups"

Jun 11 10:48:37 Lenovo-Z50-70 systemd[1]: Starting OpenBSD Secure Shell server...
Jun 11 10:48:37 Lenovo-Z50-70 sshd[23254]: Server listening on 0.0.0.0 port 22.
Jun 11 10:48:37 Lenovo-Z50-70 sshd[23254]: Server listening on :: port 22.
Jun 11 10:48:37 Lenovo-Z50-70 systemd[1]: Started OpenBSD Secure Shell server.
Jun 11 10:51:27 Lenovo-Z50-70 sshd[23877]: Accepted password for husamettin from ipaddress port 58792 ssh2
Jun 11 10:51:27 Lenovo-Z50-70 sshd[23877]: pam_unix(sshd:session): session opened for user husamettin(uid=1000) by (uid=0)

相关内容