Developer MJ

[Command] SCP 본문

Linux

[Command] SCP

MIN JOON 2017. 7. 31. 10:29

Remote server에서 Local로 디렉토리 복사

Directory / File Transfer from Server to Local


- Password

sshpass -p "password" scp -o StrictHostKeyChecking=no -r "username"@"host":"directoryPath"(1) "directoryPath"(2)

sshpass -f "passwordFilePath" scp -o StrictHostKeyChecking=no -r "username"@"host":"directoryPath"(1) "directoryPath"(2)

(1) : Remote Server Path

(2) : Local Path


sshpass Install

-ubuntu

apt install sshpass

-centos / fedora

yum install sshpass


- Private Key

scp -i "~/.ssh/id_rsa" -o StrictHostKeyChecking=no -r "username"@"host":"directoryPath" "directoryPath"