4
Hi I have an InterNiche ssh server stack running on some custom hardware.
I was trying to copy some files from server to client pc using scp command like scp user@xxx.xxx.xxx.xxx:\\path\\to\\file /local/file/path
but found that connection remains open even after I have received the file at the same time when I use pscp -scp user@xxx.xxx.xxx.xxx:\\path\\to\\file /local/file/path
it works fine without any failure. I used gitbash terminal for both scp and pscp commands.
What I am not able to understand is why there is behavioral difference between both commands, in fact pscp
use scp
itself.
Here is the debug log for PSCP command
$ pscp -scp -v user@192.168.1.12:\\demo\\test_1.txt /d/test_1.txt
admin@192.168.1.12's password:
Using username "user".
Sent password
Access granted
Opening session as main channel
Opened main channel
Started a shell/command
test_1.txt | 0 kB | 0.0 kB/s | ETA: 00:00:00 | 100%
Using SCP1
Connected to 192.168.1.12
Server sent command exit status 0
Disconnected: All channels closed
and here is for SCP
scp user@192.168.1.12:\\demo\\test_1.txt /d/test_1.txt
user@192.168.1.12's password:
debug1: Authentication succeeded (password).
Authenticated to 192.168.1.12 ([192.168.1.12]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending command: scp -v -f \\demo\\test_1.txt
Sink: C0777 16 \demo\test_1.txt
\demo\test_1.txt 100% 16 0.0KB/s 05:49 debug1: channel 0: free: client-session, nchannels 1
Killed by signal 2.
The SCP connection remains open until I hit ctrl+c manually.
What is it which keeps SCP
connection in open state even after file gets copied. Why its not closing the channel?
around 30 minutes. – user7345878 – 2018-02-06T10:31:28.000
wow ! Your problem could be related to profile scripting... : https://www.linuxquestions.org/questions/red-hat-31/scp-hangs-at-the-end-of-a-successful-transfer-739038/
– Bertrand Cebador – 2018-02-06T10:37:41.360But I am facing this issue only with one kind of sever, rest is working fine. Means scp command works fine with other devices like BBB, Rpi, but get stuck when I connect to this server. – user7345878 – 2018-02-06T11:03:58.110
also ubuntu .bashrc contains this
# If not running interactively, don't do anything case $- in *i*) ;; *) return;; esac
which takes care of the problem. – user7345878 – 2018-02-06T11:15:08.100