SCP 停在`sending command -v -t .`

Meh*_*ran 5 linux ssh scp

我正在尝试使用以下命令将文件从我的计算机发送到服务器:

scp -v file.txt username@server:~/file.txt
Run Code Online (Sandbox Code Playgroud)
  • 我在上面的命令中使用了我的用户名和真实服务器地址。

这是输入密码后的日志:

debug1: Authentication succeeded (password).
Authenticated to `server` ([`server_ip`]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_CA.UTF-8
debug1: Sending command: scp -v -t ~/file.txt
Run Code Online (Sandbox Code Playgroud)

Jak*_*uje 8

~/.bashrc,这可能会干扰远程命令(例如scp)。

module load LANG/PYTHON/2.7.6
module load TOOLS/TMUX/2.1
Run Code Online (Sandbox Code Playgroud)

如果你想做这样的事情,你应该只在交互式 shell 上做(不要破坏脚本)。您可以添加到您的开头~/.bashrc

[ -z "$PS1" ] && return
Run Code Online (Sandbox Code Playgroud)

  • 这是一个测试,变量“PS1”为空,通常用于非交互式 shell/命令。 (2认同)