commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for:
Stop tormenting the poor animal cat!
Also you should not that you need a private key not protected by a passphrase on middlehost that grants you access to securehost..
There are 9 alternatives - vote for the best!
middlehost allows ssh access from where you are but not securehost.
Use nice ssh piping to simulate scp through A => B => C
setting up the shell function if left as an exercise for the reader. ;-)
Agent forwarding should avoid password typing.
If you can do better, submit your command here.
You must be signed in to comment.
I vote for eichin's way:
tar -cf - foo.sh | ssh middlehost ssh -a securehost tar -x -C ~/ -f -This has the advantage that timestamps and permissions (important, especially for scripts) are preserved.
About ssh-agent is working for me. running on my workstation with some hop before :
WS > hostX > hostA
running the command on hostA simulating :
scp through A => B => C
in my test, hostX and B is the same server!
tar of course, is "better", you can even copy more than one script/file. keeping permission and owner wasn't a requirement, can do some prob, if the original owner on hostA doesn't exist on hostC, or you simply want to give the file to root.