Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usage of scp #7

Open
etaf opened this issue May 16, 2014 · 0 comments
Open

usage of scp #7

etaf opened this issue May 16, 2014 · 0 comments

Comments

@etaf
Copy link
Owner

etaf commented May 16, 2014

usage of scp

scp is a tool like cp in linux.The different is,scp copy file between PCs.

copy a file1 from A to B:

A~:  scp -p file1 username@B's IP : ~/file1
eg:
scp -p test.txt [email protected]:~/tset.txt

here -p measn to preserve the modify time ,access time,mode from original file.

copy a directory from A to B

A~:  scp -pr dir1 username@B's IP : ~/dir1
eg:
scp -p test_dir [email protected]:~/tset_dir

here -r means copy a directory

other option see :

man scp

scp without password

on the above step,each scp need you offer the password of the target PC.
Now there is a way to avoid the password step: by ssh certification.

A -> B whithou password

in PC A:
ssh-keygen -t rsa
scp ~/.ssh/id_rsa.pub [email protected]:~/.ssh/authorized_keys

the same for B->A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant