![Google Compute Engine: 공개 키를 사용하는 SSH가 로그아웃 후 작동을 멈춥니다.](https://linux55.com/image/148732/Google%20Compute%20Engine%3A%20%EA%B3%B5%EA%B0%9C%20%ED%82%A4%EB%A5%BC%20%EC%82%AC%EC%9A%A9%ED%95%98%EB%8A%94%20SSH%EA%B0%80%20%EB%A1%9C%EA%B7%B8%EC%95%84%EC%9B%83%20%ED%9B%84%20%EC%9E%91%EB%8F%99%EC%9D%84%20%EB%A9%88%EC%B6%A5%EB%8B%88%EB%8B%A4..png)
SSH를 통해 네트워크 터미널에 연결된 Google Compute Engine 인스턴스에서
[gcp-instance] $ ssh-copy-id user@server
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
user@server's password:
Number of key(s) added: 1
Now try logging into the machine, with: "ssh 'user@server'" and check to make sure that only the key(s) you wanted were added.
[gcp-instance] $ ssh user@server
Welcome to Linux Mint 18.3 Sylvia (GNU/Linux 4.4.0-142-generic x86_64)
....
[user@server] $
여보, 작동해요.
서버에서 다음을 설정합니다: /etc/ssh/sshd_configPasswordAuthentication no
서버를 종료하고 다시 시도해 보세요...
[user@server] $ exit
[gcp-instance] $ ssh user@server
Welcome to Linux Mint 18.3 Sylvia (GNU/Linux 4.4.0-142-generic x86_64)
....
[user@server] $
좋습니다. 다시 작동합니다. 이제 서버와 GCE 인스턴스에서 로그아웃합니다...
[user@server] $ exit
[gcp-instance] $ exit
웹 인터페이스에서 GCE 인스턴스에 다시 로그인합니다...
[gcp-instance] $ ssh user@server
Permission denied (publickey).
GCE 인스턴스를 다시 시작한 후 첫 번째와 두 번째 시도에서는 작동하지만 세 번째 시도에서는 작동하지 않는 이유는 무엇입니까?