subsystem request failed on channel
问题:
以下代码是创建文件目录,并复制文件到 nas
DEST_DIR="/volume3/docker/$(dirname ${FILE#synology/docker/})"
echo "准备创建目录 $DEST_DIR"
ssh -p 5110 [email protected] "mkdir -p $DEST_DIR"
echo "准备复制 $FILE 到 $DEST_DIR"
scp -P 5110 $FILE [email protected]:$DEST_DIR
ssh 命令没问题,但 scp 命令报如下错:
subsystem request failed on channel 0
scp: Connection closed
研究了半天,发现加个 -O
就可以解决了:
scp -O -P 5110 $FILE [email protected]:$DEST_DIR
参考:subsystem request failed on channel 0 scp: Connection closed
评论区