Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
At my University we have a Linux Cluster that I can access from home using ssh. My question is, how can I transfer files from the Cluster to my pc and vice-versa. The instructions on their site point to using scp, but someone else mentioned ftp or sftp. How do I use any of those?
You can either use scp and sftp, not ftp. The scp command is similar to cp, but you have to provide the username and the hostname of the remote machine in the source or destination path. Suppose you want to copy a file from the remote server to your local machine at home:
Code:
scp user@hostname:/path/to/remote/file .
this one copies /path/to/remote/file from the server hostname to the current working directory on your machine. Most likely you have to put the IP address of the remote server in place of the hostname, unless you associate the IP with the hostname in the file /etc/hosts on your local machine.
Some useful options of the scp command are -r to recursively copy entire directories and -p to preserve the original timestamp and permission of the remote file. Please, see man scp for details.
The sftp command is similar to ftp. You open a sftp session, then you use the sftp commands (put, get and so on). quit to close the session. Again, please see man sftp for details. Feel free to ask if you some specific problem.
All of the above information assumes that I'm logged in my current machine and not in the remote machine, right? Is there a way to transfer if I'm logged into the remote machine? I'm going to read up on sftp, it may solve my doubts.
You can connect to a machine if it has a running ssh server. Most likely your machine at home has the port 22 (ssh port) closed and hasn't got a running sshd. If you trust the network you can try to open port 22, but I'd suggest to adopt some security measure to prevent undesired intrusions (disable password login, enable public-private key authentication, restrict the access to known IP addresses and so on). The question is: is it worth the risk and the additional work? Can't you simply transfer files when you are physically at home and not vice-versa?
At my University we have a Linux Cluster that I can access from home using ssh. My question is, how can I transfer files from the Cluster to my pc and vice-versa. The instructions on their site point to using scp, but someone else mentioned ftp or sftp. How do I use any of those?
Cheers
dont use ftp because it is old, deprecated and insecure.
scp is usually used for machines to transfer stuff automatedly (especially when using ssh-keys)
sftp also runs over ssh but prompts the user for username, password, local-file, remote-file, ...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.