用户ssh正确密码登陆树莓派镜像均报错Permission denied, please try again.处理方法

本文讲述了作者在树莓派上遇到的SSH问题,包括SSHD服务未开启、防火墙影响、身份验证设置以及如何允许root用户通过密码登录。通过检查配置、重启服务等步骤,解决了SSH连接受限的问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一个树莓派镜像,启动后发现没有 sshd 功能,于是 启用 openssh,重新启动,又发现树莓派拒绝 ssh 连接请求。

我的一台树莓派IP是:192.168.59.133任何服务器使用任何用户ssh均报错,甚至连自己都不能ssh自己。

不能使用任何工具连接上该服务器

使用ssh连接自己的127.0.0.1和localhost都权限拒绝错误

ssh报错如下
任何服务器ssh报错内容均一样:报错内容均为:

Permission denied, please try again.

检查列表

sshd服务是否正常开启

sudo systemctl status ssh

关闭防火墙

sudo ufw enable

尝试sudo ufw enable,从我的win7系统ssh登录不上虚拟机。但是在本机上ssh 192.168.14.83可以登录成功

SSH两种身份验证

SSH实现身份验证,有两种:

基于密码的安全验证

基于密钥的安全验证

允许root用户登录+允许root用户登录 - 基于密码的安全验证

SSH远程连接时无法直接通过root账户登录,会显示权限不足(Permission denied, please try again.)

要开启root账户远程登录,要找到/etc/ssh/sshd_config 文件并修改其中的设置

#sudo vim /etc/ssh/sshd_config

找到并用#注释掉这行:PermitRootLogin prohibit-password

PermitRootLogin yes #允许root登录,设为yes。

PermitRootLogin prohibit-password #允许root登录,但是禁止root用密码登录

重启 SSH 服务生效

systemctl restart ssh

can't open /dev/tty: No such file or directory

root@192.168.2.50's password:
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: No such file or directory

https://blog.csdn.net/cuichongxin/article/details/117462494

ssh两种认证方式的原理

https://blog.csdn.net/marywang56/article/details/83621738

Debian 12.1开启 root 用户 ssh 登录功能

https://blog.csdn.net/weixin_45173710/article/details/136239559

C:\Users\kiki>ssh root@192.168.10.122 The authenticity of host '192.168.10.122 (192.168.10.122)' can't be established. ED25519 key fingerprint is SHA256:3aSXSmZgEArfV83eQbHRW5adsYXZ/H/JtHC7GuVJqBI. This key is not known by any other names. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '192.168.10.122' (ED25519) to the list of known hosts. root@192.168.10.122's password: Permission denied, please try again. root@192.168.10.122's password: Welcome to Linaro 14.04 (GNU/Linux 4.14.0-gb6e379910a11-dirty armv7l) * Documentation: https://wiki.analog.com/ https://ez.analog.com/ Last login: Thu Jan 1 00:00:13 1970 root@analog:~# ls openwifi root@analog:~# cd openwifi/ root@analog:~/openwifi# ./wgd.sh usage: Script for load (or download+load) different driver and FPGA img without rebooting no argument: Load .ko driver files and FPGA img (if system_top.bit.bin exist) in current dir with test_mode=0. 1st argument: If it is a NUMBER, it will be assigned to test_mode. Then load everything from current dir. 1st argument: If it is a string called "remote", it will download driver/FPGA and load everything. - 2nd argument (if exist) is the target directory name for downloading and reloading - 3rd argument (if exist) is the value for test_mode 1st argument: neither NUMBER nor "remote" nor a .tar.gz file, it is regarded as a directory and load everything from it. - 2nd argument (if exist) is the value for test_mode 1st argument: a .tar.gz file, it will be unpacked then load from that unpacked directory - 2nd argument (if exist) is the value for test_mode TARGET_DIR ./ DOWNLOAD_FLAG 0 test_mode 0 tx_offset_tuning_enable 0 $TARGET_DIR is found! network-manager stop/waiting rmmod: ERROR: Module sdr is not currently loaded rmmod: ERROR: Module ad9361_drv is not currently loaded + insmod .//ad9361_drv.ko ad9361_drv is loaded! .//system_top.bit.bin not found. Skip reloading FPGA. xlnx,zynq-7000 fjdo349ujtrueugjh
03-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值