Scp
Revision as of 10:51, 21 October 2024 by Manetta (talk | contribs) (Created page with "You can upload files to a server in the terminal with '''scp'''! scp stands for: OpenSSH secure file copy ==How to use it?== # open a terminal # navigate to the file/folder you would like to upload # use scp to upload this file/folder, see examples below # log in to the server with SSH # find the uploaded file/folder in your home folder ==Without SSH shortcut== $ scp filename.ext USERNAME@192.145.139.xxx: $ scp -r foldername USERNAME@192.145.139.xxx: ==With SSH...")
You can upload files to a server in the terminal with scp!
scp stands for: OpenSSH secure file copy
How to use it?
- open a terminal
- navigate to the file/folder you would like to upload
- use scp to upload this file/folder, see examples below
- log in to the server with SSH
- find the uploaded file/folder in your home folder
Without SSH shortcut
$ scp filename.ext USERNAME@192.145.139.xxx:
$ scp -r foldername USERNAME@192.145.139.xxx:
With SSH shortcut
$ scp filename.ext shortcut:
$ scp -r foldername shortcut:
For example:
$ scp hello.html cerealbox:
Tips!
- don't forget the ":", scp requires it; it means that it uploads something to your home folder
- you can upload the file/folder to a specific location on the server, by adding a path after the ":", for example:
$ scp filename.ext shortcut:public_html/
or
$ scp filename.ext shortcut:/var/www/html/