[Bug 2091] New: scp hangs while copying a large file and being executed as a background process ( with nohup )

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Mon Apr 15 22:40:08 EST 2013


https://bugzilla.mindrot.org/show_bug.cgi?id=2091

            Bug ID: 2091
           Summary: scp hangs while copying a large file and being
                    executed as a background process ( with nohup )
    Classification: Unclassified
           Product: Portable OpenSSH
           Version: 6.1p1
          Hardware: Other
                OS: AIX
            Status: NEW
          Severity: critical
          Priority: P5
         Component: scp
          Assignee: unassigned-bugs at mindrot.org
          Reporter: vikas.uit10 at gmail.com

Created attachment 2244
  --> https://bugzilla.mindrot.org/attachment.cgi?id=2244&action=edit
Detailed Debug info.

Problem Description - 
=====================

scp hangs while copying a large file and being executed as a background
process ( with nohup ).

The following command is used to start an scp copy in the background
and then exit the ksh. 
This should allow the user to leave a large file secure copy running
unattended but instead it 
results in 2 hung processes as shown at the end of this bug report.
This occurs only with ksh.

nohup scp /tmp/testfile test3 at target_machine:/tmp/testfile &  


============================================================================================================

Steps tp Reproduce - 
=====================                      


On the source_machine:
=======================                      

1. login as user test1                                                  

   make sure there is a user test1,                                     



2. scp /tmp/testfile test3 at target_machine:/tmp/testfile                 

   make sure ssh server is running on the target machine                

   make sure the testfile is in folder /tmp/testfile, and is big
enough, 

   about 780MB. 


   ls -l /tmp/testfile                                                  

   -rwxrwxrwx    1 root     system    827621072 Aug 31 11:06  
/tmp/testfile                                                           



3. set up scp, so that scp can be used without prompting for password   

   cd /home/test1                                                       

   ssh-keyget -t rsa                                                    

   This will prompt for a passphrase. Just press the enter key. It'll
then generate an identification 
   (private key) and a public key.          

   Your public key has been saved in <your_home_dir>/.ssh/id_rsa.pub,
/home/test1/.ssh/id_rsa.pub                                             

   ftp the /home/test1/.ssh/id_rsa.pub file to the target_machine /tmp 
folder                                                                  



On the target_machine:
=======================                      

1. login as user test3                                                  

   make sure there is a user test3,                                     



2. set up scp, so scp can be used on the source_machine without         

   prompting for password  


   cd /home/test3/.ssh                                                  

   cat /tmp/id_rsa.pub >> authorized_keys                               

   chmod 700 authorized_keys                                            



3. remove /tmp/testfile if it's existing                                

   rm -i /tmp/testfile                                                  

   make sure there is no /tmp/testfile existing on the target_machine
before running the scp command   

================================================================================================================ 


Go to the source_machine: ( still login as test1 ) 
------------------------------------------------------                  

1. make sure /tmp/testfile is there and big enough                      

   ls -l /tmp/testfile                                                  

   -rwxrwxrwx    1 root     system    827621072 Aug 31 11:06            

/tmp/testfile                                                           



2. run the scp command                                                  

   nohup scp /tmp/testfile test3 at target_machine:/tmp/testfile &         



Go to the target_machine: ( still login as test3 ) 
-----------------------------------------------------                   

   make sure the /tmp/testfile is being copied                          

   ls -l /tmp/testfile                                                  

   -rwxr-xr-x    1 test3    staff      86278144 Sep 01 12:25            

/tmp/testfile                                                           



   ls -l /tmp/testfile                                                  

   -rwxr-xr-x    1 test3    staff     169050112 Sep 01 12:25            

/tmp/testfile                                                           



   you can see the size is increasing.                                  



Go to the source_machine: ( still login as test1 ) 
-----------------------------------------------------                   

   completely logout from the source_machine, you should get the
message 

of "You have running jobs".                                             



Go to the target_machine: ( still login as test3 ) 
-----------------------------------------------------                   

   check the size of /tmp/testfile again                                

   ls -l /tmp/testfile                                                  

   -rwxr-xr-x    1 test3    staff     277184512 Sep 01 12:25            

/tmp/testfile                                                           



   ls -l /tmp/testfile                                                  

   -rwxr-xr-x    1 test3    staff     277184512 Sep 01 12:25            

/tmp/testfile                                                           



   you can see the size is not increasing any more. The scp has not     

   finished.                                                            

   The problem has been reproduced.

====================================================================================================================


Go to the source_machine and login as test1, there were 2 scp related   

processes hung after exiting from the ksh -                             



   ps -ef|grep scp                                                      

   test1 1245328       1   0 16:32:39      -  0:00 scp /tmp/testfile    

test3 at target_machine:/tmp/testfile                                      

   test1 1638838 1245328   0 16:32:39      -  0:18 /usr//bin/ssh -x     

-oForwardAgent no -oPermitLocalCommand no -oClearAllForwardings yes -l  

test3 -- target_machine scp -t -- /tmp/testfile                         

   test1 4850090 3998138   0 16:42:59  pts/1  0:00 grep scp

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list