small cluster. 1 master, 2 workers. I can access all nodes (master+slave) just fine using gcloud SDK. However, once I access the master node and try to ssh to a slave node, I get "permission denied (publickey)" error. Note that I can ping the node successfully, but SSH does not work.
Asked
Active
Viewed 779 times
0

Martijn Pieters
- 1,048,767
- 296
- 4,058
- 3,343

sermolin
- 161
- 1
- 2
- 6
-
Possible duplicate of [Google Cloud Engine. Permission denied (publickey,gssapi-keyex,gssapi-with-mic)](https://stackoverflow.com/questions/20440096/google-cloud-engine-permission-denied-publickey-gssapi-keyex-gssapi-with-mic) – rath Aug 01 '17 at 23:35
-
Possible duplicate of [SSH connection error - Permission denied (publickey)](https://stackoverflow.com/questions/40554181/ssh-connection-error-permission-denied-publickey) – Karthik Venkatraman Aug 02 '17 at 05:24
1 Answers
0
Dataproc does not install SSH keys between the master and worker nodes, so that is working as intended.
You may be able to use SSH agent forwarding. With something like:
# Add Compute Engine private key to SSH agent
ssh-add ~/.ssh/google_compute_engine
# Forward key to SSH agent of master
gcloud compute ssh --ssh-flag="-A" [CLUSTER]-m
# SSH into worker
ssh [CLUSTER]-w-0
You could also configure SSH keys using an initialization action or use gcloud ssh
from the master node (if you gave the cluster the compute.rw scope).

Patrick Clay
- 1,339
- 7
- 5