- Go to content
- Go to search
- Go to application
andUnix, you can use SCP (scp
command) to securely copy files and folders between remote computers without bootingFTPsessions or explicitly connect to remote systems. Thatscp
user of the commandSSHto transfer data, so a password or code is requiredApproval. Differentrcp
or FTP,scp
encrypts both the file and all exchanged passwords so that no one snooping on the network can see them.
Note:
Using two-factor authenticationTwo-step connection (Duo)required to access connection nodes in the IUsupercomputer researchand for SCP and SFTP file transfers on these systems. SSH public key authentication remains an option for submitting researchers"SSH Public Key Authentication on HPS Systems" after that.(Application indHPCeverywhere, everywhereusing your ownIU username and password), where you agree to provide the password for your private key when you generate your key pair. If you have questions about how two-factor authentication can affect your workflows,kontakt UITS Research Applications and Deep Learning-teamet. For help, seeGet started with two-step login (Duo) on IUiHelp for two-step login (Duo).
Pension
Pension forscp
the command is:
scp [επιλογές] username1@sourcehost:folder1/filename1 username2@destinationhost:folder2/filename2
The source file location is specifiedusername1@sourcehost:folder1/filename1
, Which contains:
- host account name (
username 1
) - The name of the host computer where the source file is located (
original_host
) - The name of the folder containing the source file (
card 1
) - Source file name (
file name 1
)
The location to which the source file is copied is specifiedusername2@destinationhost:folder2/filename2
, Which contains:
- Account name on the target computer (
username 2
) - The name of the computer to which the source file will be copied (
destination_host
) - The name of the folder where the source file will be copied (
card 2
) - Copy file name (
file name 2
)
Note:
Be sure to include a space between the source and destination paths. Also, be careful when copying files with the same name to both hosts. you may accidentally overwrite data you intended to keep.
For more aboutscp
, consult himmanual side. At the Unix prompt, type:
scp mand
At Indiana University, for personal or departmental support for Linux or Unix systems, seeGet help for Linux or Unix on IU.
Examples
For the following examples, let's assume that your username isdvader
, and you are logged in to your computer accountcarstvo.gov
:
- To copy the file named
rebels.txt
from your home foldercarstvo.gov
in the so-called foldervengeance
to your computer accountdeathstar.com
, Nurse:scp ~/rebels.txt dvader@deathstar.com:~/osveta
You will be prompted for a password on the target system (
deathstar.com
). The command will not work if you do not enter the correct password. - To copy a folder (and all the files it contains), use
scp
s-r
Choice. That's what it saysscp
to retroactively copy the original library and its contents.Da sve kopiram
vengeance
folder from yourdeathstar.com
Your user accountcarstvo.gov
account, enter:scp -r dvader@deathstar.com:~/osveta ~/osveta
You will be prompted for the password on the source system (
deathstar.com
). The command will not work if you do not enter the correct password. - To copy multiple files to a folder, you can use wildcards (eg
*
the?
). However, to use wildcards to copy multiple source files from a remote system, enclose them in quotation marks (""
) around the path to the source files. This is necessary because Unixmora, yesscp
command, expands unquoted wildcards.Therefore, copy everything
.text
files fromvengeance
folder in yourdeathstar.com
Your user accountvengeance
map enabledcarstvo.gov
, Nurse:scp dvader@deathstar.com:"osveta/*.txt" ~/osveta/
You will be prompted for the password on the source system (
deathstar.com
). The command will not work if you do not enter the correct password.
For the following example, assume that (dvader
) connected to another computer (that is, to another computer that is notcarstvo.gov
thedeathstar.com
). Copyluke.txt
from your home foldercarstvo.gov
yoursvengeance
map enableddeathstar.com
, Nurse:
scp dvader@empire.gov:~/luke.txt dvader@deathstar.com:~/revenge
You will be asked to enter two passwords: one for the source system (carstvo.gov
) and one to the target system (deathstar.com
). The command will not work if you do not enter both passwords correctly.
This is a document Received in the knowledge base.
Last changed 21-08-2023 11:18:44.