AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 1536375
Accepted
Amir Namir
Amir Namir
Asked: 2024-12-25 17:49:49 +0800 CST2024-12-25 17:49:49 +0800 CST 2024-12-25 17:49:49 +0800 CST

ssh 权限被拒绝()

  • 772

我正在尝试通过 ssh 连接到本地环境中的 raspberry pi 3 上的 ubuntu 服务器 22.04。起初我只是使用了命令,但出现了错误!所以我修改了文件并取消注释了和行。再次尝试后,我收到了错误(我被告知这是在您输入错误密码时显示的,但我输入了正确的密码)。有趣的是,我能够从 ubuntu 服务器通过 ssh 连接到 myPC,但反之则不行。我终于能够使用 puclickey 进行 ssh,但对于我和我的同事来说,使用密码验证连接到 raspberry pi 要容易得多,特别是因为它在本地网络环境中。ssh [email protected]premission denied (publickey)sshd_configPasswordAuthentication yesPublickeyAuthentication nopremission denied()

有人知道如何使用密码进行 ssh 吗?

编辑:这是 ssh -vvv 命令输出的重要部分

amir@amirux:~$ ssh -vvvv [email protected]
OpenSSH_8.9p1 Ubuntu-3ubuntu0.10, OpenSSL 3.0.2 15 Mar 2022
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug2: resolve_canonicalize: hostname 192.168.179.15 is address
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/home/amir/.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/home/amir/.ssh/known_hosts2'
debug3: ssh_connect_direct: entering
debug1: Connecting to 192.168.179.15 [192.168.179.15] port 22.
debug3: set_sock_tos: set socket 3 IP_TOS 0x10
debug1: Connection established.
.
.
.
debug1: Next authentication method: password
[email protected]'s password: 
debug3: send packet: type 50
debug2: we sent a password packet, wait for reply
debug3: receive packet: type 51
debug1: Authentications that can continue: 
Permission denied, please try again.

看来我输入了错误的密码,但我 100% 确定它是正确的。正如有人在评论部分提到的那样,cloud init 似乎安装在 RPi 上,这可以阻止密码验证吗?

server
  • 1 1 个回答
  • 56 Views

1 个回答

  • Voted
  1. Best Answer
    Amir Namir
    2024-12-30T17:29:24+08:002024-12-30T17:29:24+08:00

    感谢@user68186,我能够解决这个问题。

    • cloud initRPi 上的 可能会干扰密码验证。我通过检查使用 cloud init 日志发现less /var/log/cloud-init.log它正在修改 ssh 配置并覆盖其文件。/etc/ssh/sshd_config.d/50-cloud-init.conf日志文件中的文件路径引起了我的注意。所以我打开文件并看到那里有一行passwordAuthentication no!只需将其更改为yes,现在使用密码的 ssh 登录就可以正常工作了。感谢大家的帮助,希望遇到同样问题的人发现此解决方案有用 <3
    • 0

相关问题

  • 使用 dpkg 手动安装软件包是否会阻止未来的升级路径?

  • 如何从命令行刻录双层 dvd iso

  • 如果在服务器机器上运行 Ubuntu 桌面版,性能损失是多少?

  • 将桌面版剥离为服务器版的最简单方法是什么?

  • 如何与无头服务器进行图形交互?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve