82 Comments
- evillawngnome, on 08/08/2008, -8/+73***** this thing, scp / sftp ftw! You can't be installing non-standard tools all over your network. Learn the standards and use them. Why? Lets say one day you want to put all of your linux skills to use as a linux / unix admin. You need to push an rpm/pkg to20 servers that don't have access to the internet, but have a LAN connection. They are not running FTP. What do you do? Log into 20 servers, recompile ssh and risk downtime / dark side of the moon? OR, do you whip up a one liner:
for ip in `cat server.list`; do scp ./new-package.rpm $ip:/tmp; done
Since i'm feeling generous, i'll show you how to install that bitch in the same way:
for ip in `cat server.list`; do ssh $ip "rpm -ivh /tmp/new-package.rpm"; done
I do this regularly for the hosting company i work for. /creds - thewump, on 08/08/2008, -0/+24Nice.. but not as nice as SSHFS
- swiftsam, on 08/08/2008, -2/+20that's a bit disappointing that you have recompile ssh to add this feature.
- evillawngnome, on 08/08/2008, -1/+12The simple nature of the command is what makes it ideal. That command will work from any common *NIX server TO any *NIX server running SSH. Function and efficiency are important, not script complexity.
Furthermore, i mentioned my trade in order to lend credence to my advice to stay "tool neutral and portable", not to impress you. - antdude, on 08/08/2008, -0/+9Heh, I use zmodem (sz and rz) in SSH. :)
- traxen, on 08/08/2008, -3/+10If you thought this article was interesting and are looking into more ways of sending files/commands through a secure connection.. I would definetly recommend looking into sftp http://kb.iu.edu/data/akqg.html
- Linuturk, on 08/08/2008, -1/+7netcat FTW!
- Meekus, on 08/08/2008, -0/+5Wow... zmodem. Haven't seen that since my BBS days. Terminate, Vision/2, Telegard, Renegade!
- morrisonm, on 08/08/2008, -0/+5Has enough time passed now that I'm not a n00b for running a WWIV board back then?
RIP Strange Brew BBS, St. Louis - merreborn, on 08/09/2008, -0/+5You think this is geeky? A couple of years ago, there were articles like this on digg every day.
There used to be a lot more techies here. If anything, it's been an influx of nontechnical users. Not the other way around. - nezroy, on 08/08/2008, -0/+5Yes but then you'd have to manage a network file system configuration on 20 hosts for possibly no other reason than pushing out a single file every few months. It is far simpler to use the (much more likely to already be installed and running) SSH on the hosts than it is to setup an entire network file system arch with additional server requirements, security and auth issues, etc., just to push out a single file once in a while.
- KyjL, on 08/08/2008, -0/+4Call me dumb but doesn't SSH have SFTP built right in to it? i.e. you can already browse through files as if it was a file tree?
- pbgswd, on 08/08/2008, -1/+5ssh-xfer is not packaged for Fedora, Ubuntu, or openSUSE. Uh, thanks, really useful. SCP ftw!
- evillawngnome, on 08/08/2008, -0/+4NFS is buggy and unreliable. It's good for your home file server (as is Samba) but in a production environment, you may not have access through the firewall for NFS.
- ironiridis, on 08/08/2008, -0/+4It's not casual if it requires to patch an existing binary, on which critical security infrastructure depends. Existing tools -- tested, tried and true -- are a better solution than a hack that requires you to recompile the program that is a gatekeeper defending your private keys.
Edit: That isn't to say that the tool isn't useful ... but really, anyone who is serious enough to be SSHing around to multiple machines should simply use the tools of the trade. - dmourati, on 08/08/2008, -1/+5No you don't. You have to recompile ssh-agent.
- BlackCow, on 08/08/2008, -0/+3Instead of opening up another terminal to SCP I run FileZilla and connect via SSH to transfer files and an SSH terminal for commands. This set up works well for when im on windows using SSH for windows and FileZilla.
- javaroast, on 08/09/2008, -0/+3Cut the guy some slack. He gave an opinion, backed it up with a useful production tested tip and backed his opinion up with a solid rationale. If only more digg comments could be like this.
- fourty_two, on 08/08/2008, -0/+3I've used rsync to do a dirty, but slow, copy of an open database followed by an incremental rsync on the same closed DB for very little downtime.
- TonyJohns, on 08/09/2008, -0/+3it worries that more people don't use the sz and rz. For one, it uses the existing connection and it's plenty efficient for most things.
For two, using zmodem can achieve things you can't by using scp. For some of us, we may ssh into one box1, then from box1 to box2 that you can only get to from box1, etc. you may be through 3-4 ssh sessions. how would you now transfer a file along? Scp to box1, then log onto box1 and scp to box2, then ssh to box2 and scp to box3, etc? Or would you just do a sz and send the file and have it land directly where you active ssh session is?
Choice is clear and exists already. At least for those in the know. I'm very happy antdude that you had the same thought as me. - TheShad0w, on 08/08/2008, -0/+3Don't know about you but I prefer to connect to my machines/hosts securely.
- jessehadden, on 08/08/2008, -1/+4Problem: you have to choose whether you want to do an SCP file transfer or an SSH terminal session.
One Solution: spend the evening recompiling SSH, so you don't have to open 2 applications.
Another Solution: launch Fugu (or whatever you use), and launch an SSH terminal window. - inactive, on 08/08/2008, -1/+4Great. I'll add this to my list of things to do that are inferior to the way most people already do them. Thanks!
- ChayD, on 08/08/2008, -0/+3Oh *SNAP* I just happen to be running a multi-copy on our hosting platform right this minute. (except I'm using rsync as there are tons of files to pull off the update server.)
For anyone who's never had the pleasure of using rsync:
rsync -avx --delete [source hostname]:[source dir] [destination dir]
e.g. rsync -avx --delete 192.168.0.6:/home/blah/updates /home/blah/
Useful in that it only copies things that have changed, so you could theoretically use it for a mirrored backup from one server to another - i'm using it to just copy files in this case. If I ran the same command straight after it had finished, it would complete instantly as there were no changes since last time. RTFM for further details. - dolbersen, on 08/08/2008, -1/+3If only there were some kind of Network File System you could put the package on.
Then you could totally skip the transfer part... - traxen, on 08/08/2008, -0/+2/me smacks head..
Well, forget using sftp for anything else than transfering files ;) But it's easy for the job. - evillawngnome, on 08/08/2008, -0/+2Kind of ... It requires some back end binaries to be in place, but i'd say 99.99% of the time, if you have SSH access, SCP and SFTP will work. I've only seen it borked once, and that was due to a customized build of RHEL.
- jellygraph, on 08/08/2008, -0/+2MacFusion is pretty fast
- merreborn, on 08/09/2008, -0/+2if you RTFA, the difference is SCP requires a second SSH session.
This runs through your existing SSH session.
Usually, this doesn't matter, but TFA mentions one case in which it does -- you're connected to a remote box through several SSH session hops (e.g. you log into box A, and then from A to B, and B to C, but can't scp/SSH directly from A to C)
You're right though -- there are few cases in which ssh-xfer is worth setting up, where scp/SFTP won't do. - papastout, on 08/08/2008, -0/+2Using your comment as a tip, dugg you!
- ha3er0, on 06/16/2009, -2/+4I use floppy... Top that bitches!
- sikkdog, on 08/08/2008, -0/+2explain to me how you would do that when you have to piggyback through a frontend machine across a firewall, to another machine in that local network...ie) ssh to *1* through firewall, ssh to *2*, then transfer file back to *0*. you would have to scp twice
- javaroast, on 08/09/2008, -0/+28" Floppies are the only way to go because bigger is always better.
- kabewm, on 08/09/2008, -0/+2Even easier would be to use zmodem with this:
http://www.ohse.de/uwe/software/lrzsz.html - fluxion, on 08/09/2008, -0/+2@pyry
this is true, and that is also helpful for redirecting to a remote file without needing to create an intermediary file on the local machine...
but the point of this utility is that you do not have to create another ssh session. if you already happen to have one open, you can transfer files using the existing connection, rather than opening up a new one via scp or piping through a newly created ssh session - inactive, on 08/08/2008, -0/+2The only thing thats missing is how to use rsync, which is just as useful, and better at resuming where you left off.
- marx2k, on 08/09/2008, -0/+1?! I ssh to my home box(es) from my XP work box every day to get on IRC, NAIM, read my newsgroups, etc..
- fluxion, on 08/09/2008, -0/+1standard features often start off as patches like these. i think this one has a good chance of being merged into the official tree. you're right in general though, but i dont see any harm in using this in a home network or something
- fluxion, on 08/09/2008, -0/+1you could probably pipe through multple sessions...something similar to what pyry mentioned above, maybe:
cat file | ssh blah@server1 'cat | blah@server2 "cat >filebackslash"'
no much more convenient though, and your point still stands as far as this utility having some definite advantages over standard approaches - antdude, on 08/09/2008, -0/+1I wished PutTTY and zmodem support. It was never done and was suggested. SyncTERM's zmodem is weak. I have to use SecureCRT. :(
- bradkovach, on 08/09/2008, -0/+1Um... SFTP and SCP are built on top of SSH. so you can't really say sftp/scp FTW without saying SSH FTW.
But that is a VERY COOL IMPLEMENTATION FOR SCP. Dugg as such.
I really can't think of a single computing application that couldn't have SSH involved somehow. Port forwarding (which offers a ton of implementations), SOCKS proxy, file transfer, OMG HEAD ASPLODE. - antdude, on 08/09/2008, -0/+1MajorBBS, WWIV, Wildcat, PCboard, etc. BBS FTW!
- moghua, on 08/09/2008, -0/+1Seconded. I do periodic full backups of my laptop to my home server using something very similar:
$ tar zcf - /home/me | ssh user@host "cat - > /backup/myhome.tgz" - techbuffet, on 08/09/2008, -0/+1Another option when needing to copy large amounts of files is
ssh -e "tar -cvf -"| tar -xvf - or
tar -cvf -|ssh -e "tar -xvf -
It has been a while since I have done that, so the syntax may not be right, but it should give you the idea.
If the ssh connection is not compressed you can add a bzip or gzip into the mix as well. - evillawngnome, on 08/09/2008, -0/+1I've actually tested this for a customer who was complaining that they weren't getting all of the bandwidth uilization they should have been. We suspected they were using SCP to test the bandwidth, and we believed that SCP would have too much CPU overhead to max the connection. It was actually a long road, but one of the things we learned is that SCP and SSH both have VERY minimal load impact.
(and in case you're curious, the reason they weren't getting 100% utilization was that they didn't know what 100% was: They thought they were paying for a faster connection than they actually were.) - gravisan, on 08/09/2008, -0/+1not sure what this guy is on about , i use ssh all the time for shell and file transfers , works OOTB with both Linux and MacOS (you need to turn on ssh?)...I also recommend WinSCP which is an excellent freeware with a twin pane interface
the bonus also is that everything is encrypted! - pyry, on 08/09/2008, -2/+3There's a way you can do this without having to recompile anything...
Get file:
ssh user@hostname "cat filename" > filename
put file:
cat filename | ssh user@hostname "cat > filename" - mrBitch, on 08/09/2008, -0/+1+1 : I remember when digg articles were all about tech and tech news... *sigh*
- yevkasem, on 08/08/2008, -1/+2well gee i guess it's worthless then since you know, no one uses any other distro.
- marx2k, on 08/09/2008, -0/+1WOULD SCRIPT FROM AGAIN!! METHOD WORKS AS DESCRIBED! A+++++
-
Show 51 - 82 of 82 discussions

What is Digg?
Digg is coming to a city (and computer) near you! Check out all the details on our