You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Google Coral开发板SSH首次连接成功后提示Permission denied(publickey)求助

Fixing "permission denied(publickey)" after modifying home directory permissions on Google Coral

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 root instead of your user (usually mendel), run this to reset ownership recursively:
    sudo chown -R mendel:mendel ~
    
    Replace mendel:mendel with 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
  • 700 on .ssh ensures only you can access the directory (no other users can peek inside).
  • 600 on authorized_keys ensures 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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.14 09:14:43