rsync:SSH权限被拒绝(公钥)

业余爱好者

我有一台服务器,可以通过SSH与我的密钥文件(例如)建立SSH连接id_rsa.pub我在客户端和服务器端使用Debian。

我遵循了一个教程来禁用root身份验证和密码使用,以提高安全性(通过/etc/ssh/sshd/sshd_config在服务器上配置文件)。

到目前为止,我可以轻松地将rsync文件从计算机同步到服务器。

几天前,我使用了cron作业,为此,我不得不在服务器端重置我的root密码。

自那时以来,它一直是不可能的,我用rsyncSSH; 我收到以下消息:

[email protected]: Permission denied (publickey).
rsync: connection unexpectedly closed (0 bytes received so far)[sender]
rsync error: unexplained error (code 255) at io.c(235)[sender=3.1.3]

有一些类似的主题,但是我认为我的情况有所不同,因为我认为问题是由于在服务器上重置了密码所致。我也曾在Ask Ubuntu网站上问过一个问题,但我想也许这里的人在权限问题上更熟练。

我不知道如何解决该问题(我在终端命令中做了一些管理,但我不是计算机专家)。请问你能帮帮我吗?

仅供参考,请参阅本教程调整/etc/ssh/sshd_config不使用密码:

#Uncomment or add the following line. 
#This allows the server to give its DSA footprint in case of an ssh connection.
HostKey /etc/ssh/ssh/ssh_host_dsa_key

#Then set the next parameter to 20s (for example). 
#This is the time during which a connection without being logged in will be opened. 
#If we had kept the good old password technique, leave 2 or 3 minutes to type it, it's not too much. 
#But since we're using the key now, we'll be logged in immediately. #So we can really reduce the thing and put it down to 20 seconds for example.
LoginGraceTime 20s

#this is the maximum number of attempts before being thrown by the server.... 
#Since with the key, no possible error, you can put it to 1 possible test.
MaxAuthTries 1

#Then, we will tell the SSH server where the keys are and tell it that we will use them as an authentication method
PubkeyAuthentication yes
AuthorizedKeysFile.ssh/authorized_keys

#And of course, we'll disable all other authentication methods
RSAAuthentication no.
UsePAM no
KerberosAuthentication no
GSSAPIA Authentication no.
PasswordAuthentication no

#Then, we will tell that we only allow users of the sshusers group (for more security)
AllowGroups sshusers

#The MaxStartups setting indicates the number of un-authenticated ssh connections you can launch at the same time. 
#2 is more than enough, knowing that with the keys, it's instantaneous.
MaxStartups 2
业余爱好者

不好了!

我刚刚找到了解决方案...我的命令是:

sudo rsync -avz -e "ssh -p <port>" <source> <destination>

但是我必须简单地做到这一点(没有sudo):

rsync -avz -e "ssh -p <port>" <source> <destination>

我不确定原因,但我认为root我的台式计算机用户不允许使用SSH访问我的服务器,因为该密钥仅适用于我的classic台式机用户(因此没有sudo)。

任何人都可以确认吗?谢谢你。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

SSH权限被拒绝(公钥)

来自分类Dev

SSH权限被拒绝(公钥)

来自分类Dev

ssh权限被拒绝(公钥)

来自分类Dev

rsync后权限被拒绝(公钥)

来自分类Dev

'ssh localhost'给出'权限被拒绝(公钥)。

来自分类Dev

与SSH混淆-权限被拒绝(公钥)

来自分类Dev

ssh权限被拒绝(公钥,键盘交互)

来自分类Dev

SSH连接错误-权限被拒绝(公钥)

来自分类Dev

SSH 时权限被拒绝(公钥)

来自分类Dev

为什么这个rsync + ssh cron作业会给我“权限被拒绝(公钥)”错误?

来自分类Dev

为什么这个rsync + ssh cron作业会给我“权限被拒绝(公钥)”错误?

来自分类Dev

AWS SSH连接错误:权限被拒绝(公钥)

来自分类Dev

无法克隆,可以SSH。“权限被拒绝(公钥)。”

来自分类Dev

Bitbucket权限被拒绝(公钥)。但是可以用ssh

来自分类Dev

OpenStack:SSH到虚拟机时,权限被拒绝(公钥)

来自分类Dev

AWS EC2 SSH访问-权限被拒绝(公钥)

来自分类Dev

vscode错误中的ssh:权限被拒绝(公钥,密码)

来自分类Dev

升级Fedora 33后ssh权限被拒绝(公钥)

来自分类Dev

SSH-服务器上的权限被拒绝(公钥)

来自分类Dev

SSH密钥,CYGWIN,BitBucket,权限被拒绝(公钥)

来自分类Dev

EC2 + ssh:权限被拒绝(公钥)

来自分类Dev

git与ssh错误:权限被拒绝(公钥,键盘交互)

来自分类Dev

无法SSH到服务器:权限被拒绝(公钥)

来自分类Dev

AWS OpsWorks SSH直接连接权限被拒绝(公钥)

来自分类Dev

Raspberry Pi上的SSH权限被拒绝(公钥)

来自分类Dev

无法通过ssh连接到github;权限被拒绝(公钥)

来自分类Dev

SSH服务器权限被拒绝(公钥)

来自分类Dev

对Google计算引擎VM的SSH权限被拒绝(公钥)

来自分类Dev

AWS SSH 和 RDS 权限被拒绝 - 公钥

Related 相关文章

  1. 1

    SSH权限被拒绝(公钥)

  2. 2

    SSH权限被拒绝(公钥)

  3. 3

    ssh权限被拒绝(公钥)

  4. 4

    rsync后权限被拒绝(公钥)

  5. 5

    'ssh localhost'给出'权限被拒绝(公钥)。

  6. 6

    与SSH混淆-权限被拒绝(公钥)

  7. 7

    ssh权限被拒绝(公钥,键盘交互)

  8. 8

    SSH连接错误-权限被拒绝(公钥)

  9. 9

    SSH 时权限被拒绝(公钥)

  10. 10

    为什么这个rsync + ssh cron作业会给我“权限被拒绝(公钥)”错误?

  11. 11

    为什么这个rsync + ssh cron作业会给我“权限被拒绝(公钥)”错误?

  12. 12

    AWS SSH连接错误:权限被拒绝(公钥)

  13. 13

    无法克隆,可以SSH。“权限被拒绝(公钥)。”

  14. 14

    Bitbucket权限被拒绝(公钥)。但是可以用ssh

  15. 15

    OpenStack:SSH到虚拟机时,权限被拒绝(公钥)

  16. 16

    AWS EC2 SSH访问-权限被拒绝(公钥)

  17. 17

    vscode错误中的ssh:权限被拒绝(公钥,密码)

  18. 18

    升级Fedora 33后ssh权限被拒绝(公钥)

  19. 19

    SSH-服务器上的权限被拒绝(公钥)

  20. 20

    SSH密钥,CYGWIN,BitBucket,权限被拒绝(公钥)

  21. 21

    EC2 + ssh:权限被拒绝(公钥)

  22. 22

    git与ssh错误:权限被拒绝(公钥,键盘交互)

  23. 23

    无法SSH到服务器:权限被拒绝(公钥)

  24. 24

    AWS OpsWorks SSH直接连接权限被拒绝(公钥)

  25. 25

    Raspberry Pi上的SSH权限被拒绝(公钥)

  26. 26

    无法通过ssh连接到github;权限被拒绝(公钥)

  27. 27

    SSH服务器权限被拒绝(公钥)

  28. 28

    对Google计算引擎VM的SSH权限被拒绝(公钥)

  29. 29

    AWS SSH 和 RDS 权限被拒绝 - 公钥

热门标签

归档