Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Secure-Shell
[Top] [All Lists]

RE: openssh: Limiting bandwidth on ssh (stdin-to-dd)

Subject: RE: openssh: Limiting bandwidth on ssh (stdin-to-dd)
Date: Tue, 18 Apr 2006 12:36:18 -0500
Thanks everyone for the help! I will definitely check all of these out. 

I've started with trickle and have successfully limited the bandwidth in
the data transfer from the local machine to the remote backup server
using the command as given by Igor (limiting, for now, at 5 MB/sec).

   tar -cf - ./test_dir | trickle -s -d 5000 -u 5000 ssh
user@remote-server dd of=test_dir.tar

Now I'm trying to go the other way (restoring at 5 MB/sec), using:

   ssh user@remote-server dd if=test_dir.tar | trickle -s -d 5000 -u
5000 tar -P -xf -

In this second one, trickle doesn't seem to have any effect. The speed
is still the raw speed (without trickle) of 10 MB/sec. Do I have some
error in the command string?

Thanks again,
Mark



-----Original Message-----
From: Igor Hjelmstrom Vinhas Ribeiro [mailto:igor@dextra.com.br] 
Sent: Monday, April 17, 2006 2:22 PM
To: Holden, Mark [RICH1:B670:EXCH]
Cc: secureshell@securityfocus.com
Subject: Re: openssh: Limiting bandwidth on ssh (stdin-to-dd)


Hello!

Mark Holden wrote: 
I'm looking at using "ssh" from the openssh package, to perform secure
backups of large directories from a local server to a remote server as
in the following command executed on the local server.

  
tar -cf - ./test_dir | ssh user@remote-server dd of=test_dir.tar
    

Ie., I don't want to first create the tar file on the local system then
use scp to copy it off, as there may not be enough disk storage on the
local system to create the tar file. However, I cannot seem to find any
way, for the above style of transfer using ssh, to do something like the
"-l" option of scp to limit the amount of bandwidth used during the
transfer.

Does anybody know of a way?
  
You could use trickle. From the homepage at
http://monkey.org/~marius/pages/?page=trickle

"trickle is a portable lightweight userspace bandwidth shaper. It can
run in collaborative mode (together with trickled) or in stand alone
mode."

To limit the down bandwidth to 20 kbytes/sec and the upload to 10
kbytes/sec you could do something like:

tar -cf - ./test_dir | trickle -d 20 -u 10 ssh user@remote-server dd
of=test_dir.tar

Thanks,
Mark
  
Regards,
 Igor. 

<Prev in Thread] Current Thread [Next in Thread>