Difference between revisions of "Scp: pada port non-22"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
Line 15: | Line 15: | ||
Copy directory dari local ke to_host: | Copy directory dari local ke to_host: | ||
− | scp -P12345 r /local/directory/ username@to_host:/remote/directory/ | + | scp -P12345 -r /local/directory/ username@to_host:/remote/directory/ |
Copy file dari from_host ke to_host: | Copy file dari from_host ke to_host: | ||
scp -P12345 username@from_host:/remote/directory/file.txt username@to_host:/remote/directory/ | scp -P12345 username@from_host:/remote/directory/file.txt username@to_host:/remote/directory/ |
Latest revision as of 11:33, 2 April 2020
Pada dasarnya scp bekerja di atas ssh. Maka jika ssh di set pada port bukan 22, maka port yang digunakan scp harus di uba. Perintah scp untuk bekerja pada ssh yang bukan port 22 (misalnya 12345).
Copy file dari from_host ke local:
scp -P12345 username@from_host:file.txt /local/directory/
Copy file dari local host ke to_host:
scp -P12345 file.txt username@to_host:/remote/directory/
Copy directory dari from_host ke local:
scp -P12345 -r username@from_host:/remote/directory/ /local/directory/
Copy directory dari local ke to_host:
scp -P12345 -r /local/directory/ username@to_host:/remote/directory/
Copy file dari from_host ke to_host:
scp -P12345 username@from_host:/remote/directory/file.txt username@to_host:/remote/directory/