Monitoring SCP connections.

Posted on 2006-04-06
Last Modified: 2011-04-14
Howdy All

We have a site that uploads data to us using SCP, and it is quite a large amount of data, about a 400+ meg tar.gz from Africa, so the connection is pretty slow. Our technician over there automates it so that it happens late at night for them, and theoretically it should be done in the morning... only thing is, I don't know how to verify that it HAS finished copying by the time I get into work the next day.

I have tried "netstat --protocol=inet" and "who -aHu" (at first, I didn't realise that scp didn't create a shell session...) but neither tell me. I don't know what other commands I might be able to use. Obviously, if the TAR ball hasn't finished copying, then untar'ing it at that point is no good.

Does anyone know how I might check if the connection is still open. I know the inbound IP address they will be connecting to.

Question by:Zak_MakeWithTheFunny
    LVL 27

    Accepted Solution

    scp using sshd service for transfering files.

    Transfer in progress when:
    1) there is established connection from your server :22 port to remote site in africa
    2) file is growing

    1) netstat -an, look for local :22 port and ESTABLISHED connection state to remote site
    2) if 1) shows that there is a connection, look to file size (two times, once each 5 minutes)
    if file is growing - wait
    if connection is not established - check file size and untar
    LVL 14

    Expert Comment


    Try this command:

    ps aux | grep sshd


    Author Comment

    I didn't realise the --protocol=inet removed the entries for ssh...

    It was right there when I dropped the --protocol=inet.


    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Suggested Solutions

    I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
    Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now