Active1 year, 11 months ago
  1. Ssh File Transfer
  2. Copy Files To Linux Ssh
  1. SFTP (SSH File Transfer Protocol) is a secure file transfer protocol. It can use any SSH server as a server, and use remote files over the network as if they were.
  2. How to copy file from local to remote via ssh. Ask Question -2. This is how to shh to server. Ssh -p 2222 thatilike@192.185.21.105. Scp to copy file to remote server fails because of permissions. Copy file from remote SSH to local without SSH client on remote. Hot Network Questions.

Transferring files over SSH [closed]. Nautilus supports SCP via the Connect To Server option. Scp can only copy files to a machine running sshd, hence you need to run the client software on the remote machine from the one you are running scp on. If copying on the command line, use.

I'm SSHing into a remote server on the command line, and trying to copy a directory onto my local machine with the scp command. However, the remote server returns this 'usage' message:

I'd like to be able to transfer files in both directions. From what I read, I thought the above command would work for downloading, and scp -p [localpath] [remotepath] for uploading?

binary lobster
1251 gold badge2 silver badges10 bronze badges
Josh Maurice

closed as off topic by Shog9Jun 2 '11 at 0:55

Questions on Stack Overflow are expected to relate to programming within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

4 Answers

You need to scp something somewhere. You have scp ./styles/, so you're saying secure copy ./styles/, but not where to copy it to.

Generally, if you want to download, it will go:

where local_file might actually be a directory to put the file you're copying in. To upload, it's the opposite:

If you want to copy a whole directory, you will need -r. Think of scp as like cp, except you can specify a file with user@remote_host:file as well as just local files.

Edit: As noted in a comment, if the usernames on the local and remote hosts are the same, then the user can be omitted when specifying a remote file.

Davide Spataro
5,1011 gold badge13 silver badges32 bronze badges
lemniscalemnisca
8,1683 gold badges15 silver badges11 bronze badges

If copying to/from your desktop machine, use WinSCP, or if on Linux, Nautilus supports SCP via the Connect To Server option.

scp can only copy files to a machine running sshd, hence you need to run the client software on the remote machine from the one you are running scp on.

If copying on the command line, use:

or

JeeBeeJeeBee
16.1k4 gold badges44 silver badges58 bronze badges

You need to specify both source and destination, and if you want to copy directories you should look at the -r option.

So to recursively copy /home/user/whatever from remote server to your current directory:

KenKen
52.7k29 gold badges78 silver badges99 bronze badges

No, you still need to scp [from] [to] whichever way you're copying

The difference is, you need to scp -p server:serverpath localpath

Gareth

Ssh File Transfer

Gareth
96.3k29 gold badges138 silver badges149 bronze badges

Related Articles

  • 1 Wipe Partitions to Clean a Hard Drive
  • 2 Delete the Microsoft SQL Server Directory
  • 3 Open a PYM File
  • 4 Transfer a File Using USB

Ubuntu includes a variety of utilities for connecting to secure shell servers. The standard “ssh” command connects to the remote SSH server and provides a terminal prompt that you can use to run commands on, but you can also use the secure copy, or 'scp,' command, which connects to a remote SSH server and transfers files between your local computer and the remote computer. The SSH protocol provides encryption, so no one can eavesdrop on files copied using the 'scp' command.

Copy Files To Linux Ssh

1.

Open a terminal by clicking the “Terminal” shortcut in your applications menu.

2.

Type the following command into the terminal, replacing “/path/to/file” with the location of the file you want to upload, “username” with your username on the remote system, “example.com” with the domain name or IP address of the remote system and “/path/for/file” with the location you want to place the file on the remote system:

scp /path/to/file username@example.com:/path/for/file

3.

Press “Enter.” An authentication prompt appears.

4.

Type the remote user account’s password at the password prompt and press “Enter.” Depending on the authentication method configured on the remote SSH server, you may have to authenticate with a key or another method instead.

Tip

  • You can change the order of the files after “scp” in the command to download files from the SSH server. For example, type “scp username@example.com:/path/to/file /path/for/file” to download the file from “/path/to/file” on the remote system and place it at “/path/for/file” on the local system.

References (2)

About the Author

Copy a file from ssh

Chris Hoffman is a technology writer and all-around tech geek who writes for PC World, MakeUseOf, and How-To Geek. He's been using Windows since Windows 3.1 was released in 1992.

Photo Credits

  • Chris Hondros/Getty Images News/Getty Images
Cite this Article
Choose Citation Style
Hoffman, Chris. 'Transferring Files With SSH in Ubuntu.' Small Business - Chron.com, http://smallbusiness.chron.com/transferring-files-ssh-ubuntu-34953.html. Accessed 01 September 2019.
Hoffman, Chris. (n.d.). Transferring Files With SSH in Ubuntu. Small Business - Chron.com. Retrieved from http://smallbusiness.chron.com/transferring-files-ssh-ubuntu-34953.html
Hoffman, Chris. 'Transferring Files With SSH in Ubuntu' accessed September 01, 2019. http://smallbusiness.chron.com/transferring-files-ssh-ubuntu-34953.html
Note: Depending on which text editor you're pasting into, you might have to add the italics to the site name.