Power in Simplicity (discover the 'scp' command)
Just recently I have discovered the power which ssh-installkey utility gives for the ssh login (i.e. you don't need to enter your password to log into a remote computer after you have installed your public SSH key onto it). And you can read about it here
Now, I have discovered the power which a simple 'scp' (SSH Copy?) gives you when added to the mix. I have used stand-alone FTP clients to upload fiiles onto my server before, and well of course I'm doing it now. But man it was pretty tiresome when all you need is just to put a single file (or directory) to a known path onto a remote server. No more! You can use the scp command to perform file transfer between 2 different computers without any 3rd party utilites! AND!! Without even need to enter your password once you have installed SSH keys onto remote machine.
Have a look at how it can be achieved. First, you need of course to fire-up your terminal program. And scp should be also present on your machine. Sorry.. I'm using Mac OS X (which is FreeBSD Unix-type OS) so I don't really know how this kind of functionality can be achieved using Windows (get a mac already!)
So.. here we go. The syntax for the scp is as follows.
scp [option] sourceFile remoteFile
Pretty basic huh? There are lots of useful options you can get by typing man scp
So now down to Earth and real-life usage examples:
Here's how you copy file from your local computer to a remote one, specifying paths in both cases:
mike:~ mike$ scp /Users/mike/Desktop/counterize.php user@macdiggs.com:/path/to/www.macdiggs.com/wp-content/plugins/
counterize.php 100% 43KB 43.5KB/s 00:00
mike:~ mike$
Notice that I didn't have even to enter a password! That's because of the ssh-installkeys thingy I mentioned before.
To copy from remote computer to the local one, just swap the source and target file parameters from the example above.
You can also recursively copy directories by adding the -r option to the mix.
mike:~ mike$ scp -r /Users/mike/my_images user@macdiggs.com:/path/to/www.macdiggs.com/
06-03-09_13-35.jpg 100% 294KB 293.8KB/s 00:00
06-03-09_14-02.jpg 100% 197KB 197.3KB/s 00:00
06-03-10_14-32.jpg 100% 216KB 215.5KB/s 00:00
mike:~ mike$
Pretty nice huh? :)
June 28th, 2006 at 4:55 pm
Mike, Link is incorrect. Just 'kill' your cookie for digg.com and reload the link. You will see login page to digg.com and no content of your article.
June 28th, 2006 at 5:01 pm
ah the article is just not yet submitted :)