Linux

ssh - windows에서 linux(ubuntu)로 파일 전송하기

코딩공부 2021. 9. 24. 17:19

1) Windows에 OpenSSH Client 라는 기능이 활성화

제어판에 "앱 및 기능" -> "선택적 기능" 메뉴 -> OpenSSH 클라이언트 설치 확인

 

 

2) Windows CMD 

$ scp {window 경로}\{파일명} {linux계정}@{ubuntu public주소}:{저장될 폴더}

 

 

ERROR 1 : 

Warning: Permanently added '{ubuntu public주소}' (ECDSA) to the list of known hosts.
ubuntu@{ubuntu public주소}: Permission denied (publickey).
lost connection

 

해결 1 :

ubuntu ssh 설정의 문제

/etc/ssh/sshd_config 에서 PasswordAuthentication no 를 yes 로 변경

 

sudo vi /etc/ssh/sshd_config

수정 후 재실행

sudo service ssh restart

 

ERROR 2 :

scp {파일명}{linux 계정}@{linux public주소}:{저장될 폴더} 
{linux 계정}@{linux public주소}'s password:


scp: {저장될 폴더}/{파일명}: Permission denied

 

해결 2 : 

디렉토리에 쓰기권한 

sudo chmod 777 ./sqlbackup

 

 

완료된 콘솔화면

{파일명}                100% 4044KB  10.2MB/s   00:00