![]() |
SSH server to server
oki...
How do I transfer a file from one server to another using SSH? With FTP I can use the get or put command... But when I SSH into my server I don't have this command... :helpme |
from ssh you can do :
ftp new-host-name.com and use regular ftp -OR- scp local_file user@remotebox:/dir/to/place/file/in |
fetch
|
why use ssh then ftp? kinda defeats the purpose. use sftp or scp. type man sftp or scp for more info
|
This will transfer a file or a whoel directory tree, just execute it from the directory you are wanting to cop to the second server and have your root password the second machineready
tar cpf - . | ssh [email protected] 'cd /path/on/new/server; tar xvf -' |
For one file you may well have a command named
GET (capitalized). You can also use wget: wget ftp://user:[email protected]/dirr/file.zip There are also likely comands named "ftp" and "ncftp", but you'll need to know a few FTP commands to use them. ncftp is better and easier, if it's available. If you're transferring a lot of files, you can use a tar pipe (below). If you're transferring EVERYTHING, like moving from one dedicated server to another, you'll need to do more than just move files and having a pro handle it can save you not only a lot of hassle but also a lot of money (downtime, etc.) I've probably moved people from one server to another 100 times and I STILL carefully follow a written checklist because without it I would miss things and there would be probems. For example, if I forgot to set the DNS TTL 48 hours before the move new members may not be able to access the site for the first couple of days of their membership and expiring members may live on forever on the new server. Anyway, a tar pipe to copy a directory: copy from here to there: cd /home tar --gzip --sparse --preserve --same-owner --atime-preserve -B -cvf - . | ssh user@host "cd /home; tar -B --ungzip --preserve --same-owner --atime-preserve --sparse -xvf -" copy to me: ssh -l root otherserver.com "cd /home/user/somedir; tar -B --gzip --preserve --same-owner --atime-preserve --sparse -cvf - ." | tar --ungzip --preserve -B --same-owner --atime-preserve --sparse -xvf - |
Thanks!
:) :) :) |
|
| All times are GMT -7. The time now is 09:42 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123