为什么我不能 scp 到特定机器?
Why can't I scp to a specific machine?
我有一台机器,我似乎无法通过 scp 连接到它,但我可以通过 SSH 连接到它。我试过从两台不同的机器上进行 scping。我得到的基本输出是:
scp /tmp/file dest@IP:/tmp
Password:
IP Address:
当我向 scp 添加一些调试标志时,我可以看到我收到了一些失败消息,但我不确定它们是什么意思:
Password:
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 0
debug1: Authentication succeeded (keyboard-interactive).
Authenticated to <IP> ([<IP>]:22).
debug2: fd 4 setting O_NONBLOCK
debug2: fd 5 setting O_NONBLOCK
debug1: channel 0: new [client-session]
debug2: channel 0: send open
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug2: callback start
debug2: fd 3 setting TCP_NODELAY
debug2: client_session2_setup: id 0
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending command: scp -v -t /tmp
debug2: channel 0: request exec confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0
IP Address:
debug2: channel 0: read<=0 rfd 4 len 0
debug2: channel 0: read **failed**
debug2: channel 0: close_read
debug2: channel 0: input open -> drain
debug2: channel 0: ibuf empty
debug2: channel 0: send eof
debug2: channel 0: input drain -> **closed**
user:current_dir # debug2: channel 0: write **failed**
debug2: channel 0: close_write
debug2: channel 0: send eow
debug2: channel 0: output open -> **closed**
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug2: channel 0: rcvd eof
debug2: channel 0: rcvd close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Transferred: sent 2660, received 2380 bytes, in 0.1 seconds
Bytes per second: sent 40626.2, received 36349.8
debug1: Exit status 0
任何信息将不胜感激!
scp 不使用 sftp 协议,但需要 scp 存在并安装在接收器上(它将在接收主机的 shell 中生成一个 scp 命令)
Authenticated to <IP> ([<IP>]:22).
...
debug1: Entering interactive session.
...
debug2: exec request accepted on channel 0
IP Address:
这些都表明您已成功通过远程系统的身份验证并在那里启动了会话。 "IP Address:" 提示必须来自您会话中远程系统上的程序 运行。
简而言之,当您登录时,远程系统会自动启动一个特殊用途的程序。这将阻止 scp 和其他通过 ssh 启动的程序工作,除非该程序占用 special steps to permit them to work.
我的猜测是远程系统设置为“jump server”。它会提示您输入要连接的另一台计算机的 IP 地址。当您输入 IP 地址时,它会与该系统建立 ssh 连接(或重新启动它,或其他)。
无论该程序的目的是什么,如果不知道该程序是如何启动的,就不可能说出如何解决它。如果您有将文件复制到系统或从系统复制文件的合法需要,您应该与远程系统的管理员联系。
这是因为我试图 scp to.bashrc 的机器上的 .bashrc 正在寻找一个别名 shells 脚本,它有一个 echo var 命令。删除回声解决了问题。
我有一台机器,我似乎无法通过 scp 连接到它,但我可以通过 SSH 连接到它。我试过从两台不同的机器上进行 scping。我得到的基本输出是:
scp /tmp/file dest@IP:/tmp
Password:
IP Address:
当我向 scp 添加一些调试标志时,我可以看到我收到了一些失败消息,但我不确定它们是什么意思:
Password:
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 0
debug1: Authentication succeeded (keyboard-interactive).
Authenticated to <IP> ([<IP>]:22).
debug2: fd 4 setting O_NONBLOCK
debug2: fd 5 setting O_NONBLOCK
debug1: channel 0: new [client-session]
debug2: channel 0: send open
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug2: callback start
debug2: fd 3 setting TCP_NODELAY
debug2: client_session2_setup: id 0
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug2: channel 0: request env confirm 0
debug1: Sending command: scp -v -t /tmp
debug2: channel 0: request exec confirm 1
debug2: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug2: channel_input_status_confirm: type 99 id 0
debug2: exec request accepted on channel 0
IP Address:
debug2: channel 0: read<=0 rfd 4 len 0
debug2: channel 0: read **failed**
debug2: channel 0: close_read
debug2: channel 0: input open -> drain
debug2: channel 0: ibuf empty
debug2: channel 0: send eof
debug2: channel 0: input drain -> **closed**
user:current_dir # debug2: channel 0: write **failed**
debug2: channel 0: close_write
debug2: channel 0: send eow
debug2: channel 0: output open -> **closed**
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug2: channel 0: rcvd eof
debug2: channel 0: rcvd close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
Transferred: sent 2660, received 2380 bytes, in 0.1 seconds
Bytes per second: sent 40626.2, received 36349.8
debug1: Exit status 0
任何信息将不胜感激!
scp 不使用 sftp 协议,但需要 scp 存在并安装在接收器上(它将在接收主机的 shell 中生成一个 scp 命令)
Authenticated to <IP> ([<IP>]:22).
...
debug1: Entering interactive session.
...
debug2: exec request accepted on channel 0
IP Address:
这些都表明您已成功通过远程系统的身份验证并在那里启动了会话。 "IP Address:" 提示必须来自您会话中远程系统上的程序 运行。
简而言之,当您登录时,远程系统会自动启动一个特殊用途的程序。这将阻止 scp 和其他通过 ssh 启动的程序工作,除非该程序占用 special steps to permit them to work.
我的猜测是远程系统设置为“jump server”。它会提示您输入要连接的另一台计算机的 IP 地址。当您输入 IP 地址时,它会与该系统建立 ssh 连接(或重新启动它,或其他)。
无论该程序的目的是什么,如果不知道该程序是如何启动的,就不可能说出如何解决它。如果您有将文件复制到系统或从系统复制文件的合法需要,您应该与远程系统的管理员联系。
这是因为我试图 scp to.bashrc 的机器上的 .bashrc 正在寻找一个别名 shells 脚本,它有一个 echo var 命令。删除回声解决了问题。