|
OSXFAQ Reader Tips 
Move Files From One Computer To Another VIA "scp" Secure Copy Protocol - In Mac OS X.
OSXFAQ Reader Tip By James Kelly
Have you ever been on say machine A and want to securely move a file to another
computer? Well Secure Copy Protocol is part of OpenSSH already on your box. This
hint presumes you have a username and password on the target box and you are
already logged onto the source box.
Source_Box---------scp------------->Target_box
Open terminal and do:
vi copyhome
then type the following into the terminal window
#Useage:
#move this script someplace in your path
#like /usr/sbin by doing:
#sudo mv copyhomse /usr/sbin/copyhome
#rehash
#then cd to the directory where the
#directory where the file you want to
#move lives then do:
#scp filename ipOFtargetBox
#do:
#scp
#!/bin/sh
scp $1 targetboxUsername@"$2":/Users/targetboxHomeDirectory/.
!!!!note don't forget the period at the end of the last line of this script.
Now do:
chmod 700 copyhome
Here is how you use the script:
cd to the directory of the file you want to send then do:
copyhome filename targetbox_IP_address
Enjoy :-)
If you would like to see your tip here send it to us at contribute@osxfaq.com, You could be famous to!!
|