Google Coral开发板SSH首次连接成功后提示Permission denied(publickey)求助
Let's break down what happened here: When you ran sudo chmod -R a+rwx mendel, you recursively opened up permissions for all users on every file and folder under your home directory—including critical SSH authentication files. Even though you reset .ssh and authorized_keys to the correct permissions later, there are likely two key issues still blocking your SSH connection: incorrect file ownership, or overly permissive home directory permissions (SSH enforces strict rules here for security).
Here's how to fix this step-by-step, starting with the most likely culprits:
Step 1: Verify and fix file ownership
First, log into the Coral board via your serial connection:
- Check who owns your home directory and SSH-related files:
ls -ld ~ ls -ld ~/.ssh ls -l ~/.ssh/authorized_keys - If the owner is listed as
rootinstead of your user (usuallymendel), run this to reset ownership recursively:
Replacesudo chown -R mendel:mendel ~mendel:mendelwith your actual username and group if you've customized it.
Step 2: Secure your home directory permissions
SSH will reject public key authentication if your home directory is writable by other users. Set it to a secure, compliant permission level:
chmod 755 ~
This gives you full read/write/execute access, and read/execute access to other users—perfectly safe and aligned with SSH's security requirements.
Step 3: Double-check SSH file permissions
Even though you adjusted these earlier, re-apply the correct permissions to ensure no lingering issues:
chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys
700on.sshensures only you can access the directory (no other users can peek inside).600onauthorized_keysensures only you can read the file—SSH will ignore this file entirely if permissions are too open.
Step 4: Test the SSH connection
Exit the serial session, then try connecting from your Ubuntu desktop again:
ssh user@192.168.101.2
Replace user with your Coral board username (typically mendel) and adjust the IP address if your board uses a different one.
Bonus: Avoid this issue in the future
Never use sudo chmod -R a+rwx on your entire home directory—it breaks critical security controls and causes unintended problems like this. Instead, target specific files or folders when adjusting permissions, or use more granular settings (e.g., chmod -R 755 ~/your-target-folder for a specific directory you need to access).
内容的提问来源于stack exchange,提问作者Kaiser Sharif

