이 코드를 실행하면 오류가 발생합니다.
scp -r ./build/* rose@IP_address:/var/www/mywebsite.com/html
Permission denied(publickey)
lost connection
처음에는 작동하지만 create-react-app 웹사이트에 일부 변경 사항을 적용하려고 하면 작동하지 않습니다.
이것은 단편이다
scp -vvv -r ./build/* rose@IP_address:/var/www/mywebsite.com/html
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "IP_address" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to IP_address [IP_address] port 22.
debug1: Connection established.
debug1: identity file /home/rose/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /home/rose/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/rose/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/rose/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/rose/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/rose/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/rose/.ssh/id_ed25519 type -1
도와주세요.
답변1
그래서 나는 이 문제에 대한 해결책을 찾았습니다. 나는 갔다
sudo nano /etc/ssh/sshd_config
그리고 PasswordAuthentication no
로 바뀌었다PasswordAuthentication yes
PermitRootLogin no
그리고PermitRootLogin yes
그러다가 달리고 sudo systemctl restart sshd
달리고 ssh user@IP_address
성공했어요.