Also, I am copying from HOME to HOME, which is why it is not necessary to type the full path of the files either. In this case, as the user is repeated on both machines, it is not necessary to type it. If you want to copy something to or from there, you can omit the path: scp list.txt earendil-desktop: This would copy the ~ / my stuff / photos / folder from the remote computer to the HOME folder on the computer I'm using.įinally, it is important to note that the default path is your user folder. Now, the same process in reverse would be: scp earendil earendil-desktop: ~ / my stuff / photos ~ This command copies the photos folder, located in the HOME of the computer that I am using, to the mythings folder, which is located in the HOME of my remote computer. I wouldn't recommend copying /.ssh over, better to just copy only what you need. To copy entire folders, just add the -r parameter: scp -r ~ / earendil photos earendil-desktop: ~ / miscosas 3 Answers Sorted by: 3 You can copy the keys themselves over using any method, even copying the contents of the keyfile and pasting it into the 'authorized keys' file on the remote server will work. The owner of this file will be the earendil user (of my remote computer). This command copies the file list.txt from the computer I am using to the ~ / miscosas folder on my remote computer. That is, for example, if we wanted to send something to the remote computer: scp list.txt earendil earendil-desktop: ~ / miscosas To copy in reverse, from the remote computer to yours, I simply reversed the order: scp user server: path / file local_path Thanks to Snocks, we know that it is also possible to add a line, in the format "IP hostname", to the file / Etc / hosts. The FTP protocol has an FXP extension that allows this, but it is disabled on majority of FTP servers.Note: In case you get the error "ssh: Could not resolve hostname earendil-desktop: Name or service not known lost connection", try replacing server with the server's IP number. 13 Answers Sorted by: 95 This is probably not a direct answer to what youre asking, but when I need to transfer files over a SSH session I use WinSCP, which is an excellent file transfer program over SCP or SFTP.So practically it would have advantage for advanced users only, who can use the “custom command” solution easily. It would require not only major changes in WinSCP, but also many configuration changes on both servers to allow authentication on the second server from the first one (note that it would not be possible to use an interactive password authentication). With the SCP protocol it may be theoretically possible.Reasons why the feature is not built into With the SFTP and SCP protocols, you can use a suitable remote command to download files to the remote server from another server. With the SFTP and SCP protocols, you can push the selected remote files to another server using the scp custom command. Yet, there are ways to utilize some advanced features of WinSCP to achieve the task. The command to create a new directory is mkdir: mkdir mydir cd mydir/ Move files and directories The mv command moves both directories and files. This feature is not built into WinSCP, for reasons listed further down. On server A: scp -r /path/to/directory someuserserverB:/path/to/files/. To transfer files directly from one server to another There is also an extension to synchronize files between servers. See documentation to learn how to duplicate files between sessions. Advertisement To transfer files between the two servers via local workstation
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |