Or you can use the trick that scp uses and use such a command line: ssh -p 6774 scp -rp -P 6774 /home/denny/testapp1.txt the different case of the port parameter for ssh and scp: ssh -p 6774 vs. When you have setup your ~/.ssh/config correctly, this should work: scp -rp3 course, you can also copy the contents of the ~/.ssh/config file onto your first remote host, and then you can use scp without the -3 option, which will probably speeden up the transfer. With scp you can copy files between remote servers from a third server without the need to ssh into any of them, all weight lifting will be done by scp itself. Otherwise, scp issues the scp command via ssh on the first host, so it actually runs ssh -p 6774 scp -rp /home/denny/testapp1.txt then the ~/.ssh/config of the first remote host (67.12.21.133) is used instead of your local one. To copy directory, you need to add -r parameter. If you have to enter the password for sudo, then the two step way is needed. This will copy the file over to the other system, into the fieldmouse userid, with the name 'thatfile'. With SCP, you have to do in two steps, however, you can do it in one with rsync as follows: rsync -rsync-path'sudo rsync' USERSERVER2:/root Note: This does require NOPASSWD sudo configuration.While on alice, use the command 'scp myfile fieldmousemadhat:thatfile'. You can use this as a 'push' or a 'pull' command, but let's start with pushing the file to the other server. When doing this, you have to use the option -3 to scp, which copies the files through your local machine. For a single file, try the 'scp' command. You can use ~/.ssh/config to specify the ports to use for the hosts (and for setting many other nice things check the man page man ssh_config): # ~/.ssh/config
0 Comments
Leave a Reply. |