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 [email protected]:\\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 [email protected]:\\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 [email protected]:\\demo\\test_1.txt /d/test_1.txt [email protected]'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 [email protected]:\\demo\\test_1.txt /d/test_1.txt [email protected]'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?