我更改了目录的权限,现在我无法 SCP

我更改了目录的权限,现在我无法 SCP

我有一个 EC2 实例。我的服务器设置如下:

var/www/html/emmetarriesemmetphoto。我更改了($ )emmetphotodev的权限。emmetphotosudo chmod 777 /var/www/html/emmetphoto


我现在无法使用 SCP 上传文件。以前可以。我的 SCP 命令没有改变。

rm -r编辑了,emmetphoto但它仍然不起作用。

我尝试运行:

sudo chmod -R 755 /var/www/html

sudo chown -R apache:apache /var/www/html

sudo chown -R ec2-user:ec2-user /var/www/html

不起作用。我在 Google 上搜索了一个多小时,什么也没用。


我尝试使用 运行 SCP -v,得到了以下结果:

Executing: program /usr/bin/ssh host ec2-52-37-149-108.us-west-2.compute.amazonaws.com, user ec2-user, command scp -v -r -p -t /var/www/html/
OpenSSH_7.3p1, LibreSSL 2.4.1
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug1: Connecting to ec2-52-37-149-108.us-west-2.compute.amazonaws.com [52.37.149.108] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /Users/emmet/Desktop/test.pem type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/emmet/Desktop/test.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.3
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000
debug1: Authenticating to ec2-52-37-149-108.us-west-2.compute.amazonaws.com:22 as 'ec2-user'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:iCfVNRD/rr7Y92/R/yi+pFmXF9mNFzZU7FaDlRa64Qk
debug1: Host 'ec2-52-37-149-108.us-west-2.compute.amazonaws.com' is known and matches the ECDSA host key.
debug1: Found key in /Users/emmet/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /Users/emmet/Desktop/test.pem
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).
lost connection

我很乐意运行任何命令。我真的需要修复这个问题。

如果您需要更多信息,请发表评论!

我衷心感谢您!

埃米特


编辑1:

我使用的命令是:

scp -i /Users/emmet/Desktop/test.pem -rp /Users/emmet/Desktop/emmetphoto [email protected]:/var/www/html/


编辑2:

错误日志显示:

[Thu Feb 16 03:50:01.351745 2017] [mpm_prefork:notice] [pid 30322] AH00173: SIGHUP received.  Attempting to restart
[Thu Feb 16 03:50:01.406025 2017] [auth_digest:notice] [pid 30322] AH01757: generating secret for digest authentication ...
[Thu Feb 16 03:50:01.406609 2017] [lbmethod_heartbeat:notice] [pid 30322] AH02282: No slotmem from mod_heartmonitor
[Thu Feb 16 03:50:01.429869 2017] [mpm_prefork:notice] [pid 30322] AH00163: Apache/2.4.25 (Amazon) PHP/5.6.29 configured -- resuming normal operations
[Thu Feb 16 03:50:01.429889 2017] [core:notice] [pid 30322] AH00094: Command line: '/usr/sbin/httpd'
rm: cannot remove '/var/www/html/emmetphoto/kings-beach-womens-march/index.php': Permission denied
rm: cannot remove '/var/www/html/emmetphoto/about/index.php': Permission denied
rm: cannot remove '/var/www/html/emmetphoto/nature/index.php': Permission denied
rm: cannot remove '/var/www/html/emmetphoto/nature/index.php': Permission denied
rm: cannot remove '/var/www/html/emmetphoto/nature/index.php': Permission denied
rm: cannot remove '/var/www/html/emmetphoto/kings-beach-womens-march/index.php': Permission denied
[Thu Feb 16 06:51:54.465527 2017] [mpm_prefork:notice] [pid 30322] AH00169: caught SIGTERM, shutting down
[Thu Feb 16 06:51:54.580369 2017] [suexec:notice] [pid 3275] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Feb 16 06:51:54.604880 2017] [auth_digest:notice] [pid 3276] AH01757: generating secret for digest authentication ...
[Thu Feb 16 06:51:54.605639 2017] [lbmethod_heartbeat:notice] [pid 3276] AH02282: No slotmem from mod_heartmonitor
[Thu Feb 16 06:51:54.626199 2017] [mpm_prefork:notice] [pid 3276] AH00163: Apache/2.4.25 (Amazon) PHP/5.6.29 configured -- resuming normal operations
[Thu Feb 16 06:51:54.626217 2017] [core:notice] [pid 3276] AH00094: Command line: '/usr/sbin/httpd'
[Thu Feb 16 07:29:50.659829 2017] [mpm_prefork:notice] [pid 3276] AH00169: caught SIGTERM, shutting down
[Thu Feb 16 07:29:50.764740 2017] [suexec:notice] [pid 3515] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Feb 16 07:29:50.789254 2017] [auth_digest:notice] [pid 3516] AH01757: generating secret for digest authentication ...
[Thu Feb 16 07:29:50.789831 2017] [lbmethod_heartbeat:notice] [pid 3516] AH02282: No slotmem from mod_heartmonitor
[Thu Feb 16 07:29:50.810599 2017] [mpm_prefork:notice] [pid 3516] AH00163: Apache/2.4.25 (Amazon) PHP/5.6.29 configured -- resuming normal operations
[Thu Feb 16 07:29:50.810618 2017] [core:notice] [pid 3516] AH00094: Command line: '/usr/sbin/httpd'

编辑3:

来自secure日志。

在此之前还有更多。我达到了 30000 个字符的限制。:)

Feb 16 07:33:24 ip-172-31-19-149 sshd[3568]: input_userauth_request: invalid user haldaemon [preauth]
Feb 16 07:33:24 ip-172-31-19-149 sshd[3568]: Connection closed by 187.19.48.6 [preauth]
Feb 16 07:33:26 ip-172-31-19-149 sshd[3571]: reverse mapping checking getaddrinfo for 71-83-110-240.dhcp.reno.nv.charter.com [71.83.110.240] failed - POSSIBLE BREAK-IN ATTEMPT!
Feb 16 07:33:27 ip-172-31-19-149 sshd[3571]: Authentication refused: bad ownership or modes for file /home/ec2-user/.ssh/authorized_keys
Feb 16 07:33:27 ip-172-31-19-149 sshd[3571]: Connection closed by 71.83.110.240 [preauth]
Feb 16 07:35:38 ip-172-31-19-149 sudo: ec2-user : TTY=pts/0 ; PWD=/var/www/html ; USER=root ; COMMAND=/bin/bash
Feb 16 07:36:18 ip-172-31-19-149 sshd[3596]: Connection closed by 187.19.48.6 [preauth]
Feb 16 07:38:25 ip-172-31-19-149 sshd[3598]: Connection closed by 187.19.48.6 [preauth]
Feb 16 07:40:14 ip-172-31-19-149 sshd[3602]: Invalid user deploy from 187.19.48.6
Feb 16 07:40:14 ip-172-31-19-149 sshd[3602]: input_userauth_request: invalid user deploy [preauth]
Feb 16 07:40:14 ip-172-31-19-149 sshd[3602]: Connection closed by 187.19.48.6 [preauth]
Feb 16 07:42:21 ip-172-31-19-149 sshd[3604]: Invalid user poll from 187.19.48.6
Feb 16 07:42:21 ip-172-31-19-149 sshd[3604]: input_userauth_request: invalid user poll [preauth]
Feb 16 07:42:21 ip-172-31-19-149 sshd[3604]: Connection closed by 187.19.48.6 [preauth]
Feb 16 07:44:52 ip-172-31-19-149 sshd[3642]: Invalid user noreply from 187.19.48.6
Feb 16 07:44:52 ip-172-31-19-149 sshd[3642]: input_userauth_request: invalid user noreply [preauth]
Feb 16 07:44:52 ip-172-31-19-149 sshd[3642]: Connection closed by 187.19.48.6 [preauth]
Feb 16 07:47:41 ip-172-31-19-149 sshd[3645]: Invalid user ftpadmin from 187.19.48.6
Feb 16 07:47:41 ip-172-31-19-149 sshd[3645]: input_userauth_request: invalid user ftpadmin [preauth]
Feb 16 07:47:41 ip-172-31-19-149 sshd[3645]: Connection closed by 187.19.48.6 [preauth]
Feb 16 07:50:34 ip-172-31-19-149 sshd[3648]: Invalid user ftpadmin from 187.19.48.6
Feb 16 07:50:34 ip-172-31-19-149 sshd[3648]: input_userauth_request: invalid user ftpadmin [preauth]
Feb 16 07:50:34 ip-172-31-19-149 sshd[3648]: Connection closed by 187.19.48.6 [preauth]
Feb 16 07:53:27 ip-172-31-19-149 sshd[3651]: Invalid user ftpadmin from 187.19.48.6
Feb 16 07:53:27 ip-172-31-19-149 sshd[3651]: input_userauth_request: invalid user ftpadmin [preauth]
Feb 16 07:53:27 ip-172-31-19-149 sshd[3651]: Connection closed by 187.19.48.6 [preauth]
Feb 16 07:56:09 ip-172-31-19-149 sshd[3654]: Invalid user ftpadmin from 187.19.48.6
Feb 16 07:56:09 ip-172-31-19-149 sshd[3654]: input_userauth_request: invalid user ftpadmin [preauth]
Feb 16 07:56:09 ip-172-31-19-149 sshd[3654]: Connection closed by 187.19.48.6 [preauth]
Feb 16 07:59:02 ip-172-31-19-149 sshd[3656]: Invalid user ftpadmin from 187.19.48.6
Feb 16 07:59:02 ip-172-31-19-149 sshd[3656]: input_userauth_request: invalid user ftpadmin [preauth]
Feb 16 07:59:02 ip-172-31-19-149 sshd[3656]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:01:54 ip-172-31-19-149 sshd[3670]: Invalid user ftpadmin from 187.19.48.6
Feb 16 08:01:54 ip-172-31-19-149 sshd[3670]: input_userauth_request: invalid user ftpadmin [preauth]
Feb 16 08:01:54 ip-172-31-19-149 sshd[3670]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:03:21 ip-172-31-19-149 sshd[3672]: Bad protocol version identification 'CONNECT 45.33.54.195:80 HTTP/1.0' from 66.91.17.103 port 63011
Feb 16 08:03:22 ip-172-31-19-149 sshd[3673]: Did not receive identification string from 66.91.17.103
Feb 16 08:03:22 ip-172-31-19-149 sshd[3674]: Did not receive identification string from 66.91.17.103
Feb 16 08:03:22 ip-172-31-19-149 sshd[3675]: Bad protocol version identification 'GET http://proxyjudge.us/judge.php HTTP/1.0' from 66.91.17.103 port 63049
Feb 16 08:03:48 ip-172-31-19-149 sshd[3676]: Bad protocol version identification 'CONNECT 216.58.209.196:80 HTTP/1.0' from 86.106.16.69 port 64217
Feb 16 08:03:49 ip-172-31-19-149 sshd[3677]: Did not receive identification string from 86.106.16.69
Feb 16 08:03:49 ip-172-31-19-149 sshd[3678]: Did not receive identification string from 86.106.16.69
Feb 16 08:03:49 ip-172-31-19-149 sshd[3679]: Bad protocol version identification 'GET http://www.google.com/search?q=213.64.131.79%3A45554 HTTP/1.0' from 86.106.16.69 port 64982
Feb 16 08:04:48 ip-172-31-19-149 sshd[3680]: Invalid user ftpadmin from 187.19.48.6
Feb 16 08:04:48 ip-172-31-19-149 sshd[3680]: input_userauth_request: invalid user ftpadmin [preauth]
Feb 16 08:04:48 ip-172-31-19-149 sshd[3680]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:07:02 ip-172-31-19-149 sshd[3684]: Bad protocol version identification 'CONNECT proxyjudge.us:80 HTTP/1.0' from 45.117.156.126 port 50258
Feb 16 08:07:03 ip-172-31-19-149 sshd[3685]: Did not receive identification string from 45.117.156.126
Feb 16 08:07:03 ip-172-31-19-149 sshd[3686]: Did not receive identification string from 45.117.156.126
Feb 16 08:07:03 ip-172-31-19-149 sshd[3687]: Bad protocol version identification 'GET http://proxyjudge.us/judge.php HTTP/1.0' from 45.117.156.126 port 50392
Feb 16 08:07:41 ip-172-31-19-149 sshd[3688]: Invalid user ftpadmin from 187.19.48.6
Feb 16 08:07:41 ip-172-31-19-149 sshd[3688]: input_userauth_request: invalid user ftpadmin [preauth]
Feb 16 08:07:41 ip-172-31-19-149 sshd[3688]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:08:15 ip-172-31-19-149 sudo:     root : TTY=pts/0 ; PWD=/var/www/html ; USER=root ; COMMAND=/bin/chmod 755 /var/log/httpd
Feb 16 08:10:34 ip-172-31-19-149 sshd[3730]: Invalid user ftpadmin from 187.19.48.6
Feb 16 08:10:34 ip-172-31-19-149 sshd[3730]: input_userauth_request: invalid user ftpadmin [preauth]
Feb 16 08:10:34 ip-172-31-19-149 sshd[3730]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:13:29 ip-172-31-19-149 sshd[3732]: Invalid user ftpadmin from 187.19.48.6
Feb 16 08:13:29 ip-172-31-19-149 sshd[3732]: input_userauth_request: invalid user ftpadmin [preauth]
Feb 16 08:13:29 ip-172-31-19-149 sshd[3732]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:16:10 ip-172-31-19-149 sshd[3735]: Bad protocol version identification 'CONNECT 213.180.204.62:443 HTTP/1.0' from 91.186.8.91 port 51148
Feb 16 08:16:10 ip-172-31-19-149 sshd[3736]: Did not receive identification string from 91.186.8.91
Feb 16 08:16:11 ip-172-31-19-149 sshd[3737]: Did not receive identification string from 91.186.8.91
Feb 16 08:16:11 ip-172-31-19-149 sshd[3738]: Bad protocol version identification 'GET https://www.yandex.com/search/?text=125.124.188.115%3A9999 HTTP/1.0' from 91.186.8.91 port 51205
Feb 16 08:16:11 ip-172-31-19-149 sshd[3739]: Bad protocol version identification 'CONNECT 204.79.197.200:80 HTTP/1.0' from 91.186.8.91 port 51246
Feb 16 08:16:12 ip-172-31-19-149 sshd[3742]: Did not receive identification string from 91.186.8.91
Feb 16 08:16:12 ip-172-31-19-149 sshd[3743]: Bad protocol version identification 'GET http://www.bing.com/search?q=125.124.188.115%3A9999 HTTP/1.0' from 91.186.8.91 port 51303
Feb 16 08:16:12 ip-172-31-19-149 sshd[3744]: Bad protocol version identification 'CONNECT 45.33.54.195:80 HTTP/1.0' from 91.186.8.91 port 51325
Feb 16 08:16:12 ip-172-31-19-149 sshd[3745]: Did not receive identification string from 91.186.8.91
Feb 16 08:16:13 ip-172-31-19-149 sshd[3746]: Bad protocol version identification 'GET http://proxyjudge.us/judge.php HTTP/1.0' from 91.186.8.91 port 51366
Feb 16 08:16:13 ip-172-31-19-149 sshd[3747]: Bad protocol version identification 'CONNECT 217.12.15.96:80 HTTP/1.0' from 91.186.8.91 port 51389
Feb 16 08:16:13 ip-172-31-19-149 sshd[3748]: Did not receive identification string from 91.186.8.91
Feb 16 08:16:13 ip-172-31-19-149 sshd[3749]: Bad protocol version identification 'GET http://search.yahoo.com/search?p=125.124.188.115%3A9999 HTTP/1.0' from 91.186.8.91 port 51446
Feb 16 08:16:14 ip-172-31-19-149 sshd[3750]: Bad protocol version identification 'CONNECT 192.0.78.17:443 HTTP/1.0' from 91.186.8.91 port 51465
Feb 16 08:16:14 ip-172-31-19-149 sshd[3751]: Did not receive identification string from 91.186.8.91
Feb 16 08:16:14 ip-172-31-19-149 sshd[3752]: Bad protocol version identification 'GET https://wordpress.com/ HTTP/1.0' from 91.186.8.91 port 51506
Feb 16 08:16:15 ip-172-31-19-149 sshd[3753]: Bad protocol version identification 'CONNECT 162.249.125.79:80 HTTP/1.0' from 91.186.8.91 port 51530
Feb 16 08:16:15 ip-172-31-19-149 sshd[3754]: Did not receive identification string from 91.186.8.91
Feb 16 08:16:15 ip-172-31-19-149 sshd[3756]: Bad protocol version identification 'GET http://www.sbjudge3.com/ip4.php HTTP/1.0' from 91.186.8.91 port 51587
Feb 16 08:16:22 ip-172-31-19-149 sshd[3740]: Invalid user ftpadmin from 187.19.48.6
Feb 16 08:16:22 ip-172-31-19-149 sshd[3740]: input_userauth_request: invalid user ftpadmin [preauth]
Feb 16 08:16:22 ip-172-31-19-149 sshd[3740]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:18:51 ip-172-31-19-149 sshd[3757]: Invalid user ftpadmin from 187.19.48.6
Feb 16 08:18:51 ip-172-31-19-149 sshd[3757]: input_userauth_request: invalid user ftpadmin [preauth]
Feb 16 08:18:51 ip-172-31-19-149 sshd[3757]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:19:35 ip-172-31-19-149 sshd[3759]: Bad protocol version identification 'CONNECT 45.33.54.195:80 HTTP/1.0' from 139.167.3.169 port 56207
Feb 16 08:19:36 ip-172-31-19-149 sshd[3760]: Did not receive identification string from 139.167.3.169
Feb 16 08:19:37 ip-172-31-19-149 sshd[3761]: Did not receive identification string from 139.167.3.169
Feb 16 08:19:37 ip-172-31-19-149 sshd[3762]: Bad protocol version identification 'GET http://proxyjudge.us/judge.php HTTP/1.0' from 139.167.3.169 port 56226
Feb 16 08:20:01 ip-172-31-19-149 sshd[3763]: reverse mapping checking getaddrinfo for 71-83-110-240.dhcp.reno.nv.charter.com [71.83.110.240] failed - POSSIBLE BREAK-IN ATTEMPT!
Feb 16 08:20:01 ip-172-31-19-149 sshd[3763]: Authentication refused: bad ownership or modes for file /home/ec2-user/.ssh/authorized_keys
Feb 16 08:20:01 ip-172-31-19-149 sshd[3763]: Connection closed by 71.83.110.240 [preauth]
Feb 16 08:20:58 ip-172-31-19-149 sshd[3765]: reverse mapping checking getaddrinfo for 71-83-110-240.dhcp.reno.nv.charter.com [71.83.110.240] failed - POSSIBLE BREAK-IN ATTEMPT!
Feb 16 08:20:58 ip-172-31-19-149 sshd[3765]: Invalid user user from 71.83.110.240
Feb 16 08:20:58 ip-172-31-19-149 sshd[3765]: input_userauth_request: invalid user user [preauth]
Feb 16 08:20:58 ip-172-31-19-149 sshd[3765]: Connection closed by 71.83.110.240 [preauth]
Feb 16 08:21:12 ip-172-31-19-149 sshd[3767]: reverse mapping checking getaddrinfo for 71-83-110-240.dhcp.reno.nv.charter.com [71.83.110.240] failed - POSSIBLE BREAK-IN ATTEMPT!
Feb 16 08:21:12 ip-172-31-19-149 sshd[3767]: Invalid user user from 71.83.110.240
Feb 16 08:21:12 ip-172-31-19-149 sshd[3767]: input_userauth_request: invalid user user [preauth]
Feb 16 08:21:12 ip-172-31-19-149 sshd[3767]: Connection closed by 71.83.110.240 [preauth]
Feb 16 08:21:23 ip-172-31-19-149 sshd[3769]: Invalid user ftpuser from 187.19.48.6
Feb 16 08:21:23 ip-172-31-19-149 sshd[3769]: input_userauth_request: invalid user ftpuser [preauth]
Feb 16 08:21:23 ip-172-31-19-149 sshd[3769]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:24:18 ip-172-31-19-149 sshd[3771]: Invalid user ftpuser from 187.19.48.6
Feb 16 08:24:18 ip-172-31-19-149 sshd[3771]: input_userauth_request: invalid user ftpuser [preauth]
Feb 16 08:24:18 ip-172-31-19-149 sshd[3771]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:24:52 ip-172-31-19-149 sshd[3773]: Bad protocol version identification 'CONNECT 45.33.54.195:80 HTTP/1.0' from 62.210.111.46 port 8667
Feb 16 08:24:53 ip-172-31-19-149 sshd[3774]: Did not receive identification string from 62.210.111.46
Feb 16 08:24:53 ip-172-31-19-149 sshd[3775]: Did not receive identification string from 62.210.111.46
Feb 16 08:24:53 ip-172-31-19-149 sshd[3776]: Bad protocol version identification 'GET http://proxyjudge.us/judge.php HTTP/1.0' from 62.210.111.46 port 49535
Feb 16 08:27:12 ip-172-31-19-149 sshd[3779]: Invalid user ftpuser from 187.19.48.6
Feb 16 08:27:12 ip-172-31-19-149 sshd[3779]: input_userauth_request: invalid user ftpuser [preauth]
Feb 16 08:27:12 ip-172-31-19-149 sshd[3779]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:30:07 ip-172-31-19-149 sshd[3783]: Invalid user ftpuser from 187.19.48.6
Feb 16 08:30:07 ip-172-31-19-149 sshd[3783]: input_userauth_request: invalid user ftpuser [preauth]
Feb 16 08:30:07 ip-172-31-19-149 sshd[3783]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:33:02 ip-172-31-19-149 sshd[3786]: Invalid user ftpuser from 187.19.48.6
Feb 16 08:33:02 ip-172-31-19-149 sshd[3786]: input_userauth_request: invalid user ftpuser [preauth]
Feb 16 08:33:02 ip-172-31-19-149 sshd[3786]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:35:25 ip-172-31-19-149 sshd[3788]: Bad protocol version identification 'CONNECT 45.33.54.195:80 HTTP/1.0' from 62.210.80.31 port 13404
Feb 16 08:35:26 ip-172-31-19-149 sshd[3789]: Did not receive identification string from 62.210.80.31
Feb 16 08:35:26 ip-172-31-19-149 sshd[3790]: Did not receive identification string from 62.210.80.31
Feb 16 08:35:26 ip-172-31-19-149 sshd[3791]: Bad protocol version identification 'GET http://proxyjudge.us/judge.php HTTP/1.0' from 62.210.80.31 port 34779
Feb 16 08:35:57 ip-172-31-19-149 sshd[3792]: Invalid user ftpuser from 187.19.48.6
Feb 16 08:35:57 ip-172-31-19-149 sshd[3792]: input_userauth_request: invalid user ftpuser [preauth]
Feb 16 08:35:57 ip-172-31-19-149 sshd[3792]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:38:52 ip-172-31-19-149 sshd[3832]: Invalid user ftpuser from 187.19.48.6
Feb 16 08:38:52 ip-172-31-19-149 sshd[3832]: input_userauth_request: invalid user ftpuser [preauth]
Feb 16 08:38:52 ip-172-31-19-149 sshd[3832]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:40:08 ip-172-31-19-149 sshd[3835]: reverse mapping checking getaddrinfo for 71-83-110-240.dhcp.reno.nv.charter.com [71.83.110.240] failed - POSSIBLE BREAK-IN ATTEMPT!
Feb 16 08:40:08 ip-172-31-19-149 sshd[3835]: Authentication refused: bad ownership or modes for file /home/ec2-user/.ssh/authorized_keys
Feb 16 08:40:08 ip-172-31-19-149 sshd[3835]: Connection closed by 71.83.110.240 [preauth]
Feb 16 08:41:46 ip-172-31-19-149 sshd[3837]: Invalid user ftpuser from 187.19.48.6
Feb 16 08:41:46 ip-172-31-19-149 sshd[3837]: input_userauth_request: invalid user ftpuser [preauth]
Feb 16 08:41:46 ip-172-31-19-149 sshd[3837]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:44:41 ip-172-31-19-149 sshd[3840]: Invalid user ftpuser from 187.19.48.6
Feb 16 08:44:41 ip-172-31-19-149 sshd[3840]: input_userauth_request: invalid user ftpuser [preauth]
Feb 16 08:44:41 ip-172-31-19-149 sshd[3840]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:46:42 ip-172-31-19-149 sshd[3845]: Received disconnect from 221.194.44.219: 11:  [preauth]
Feb 16 08:47:35 ip-172-31-19-149 sshd[3848]: Invalid user ftpuser from 187.19.48.6
Feb 16 08:47:35 ip-172-31-19-149 sshd[3848]: input_userauth_request: invalid user ftpuser [preauth]
Feb 16 08:47:35 ip-172-31-19-149 sshd[3848]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:50:29 ip-172-31-19-149 sshd[3852]: Invalid user ftpuser from 187.19.48.6
Feb 16 08:50:29 ip-172-31-19-149 sshd[3852]: input_userauth_request: invalid user ftpuser [preauth]
Feb 16 08:50:29 ip-172-31-19-149 sshd[3852]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:52:58 ip-172-31-19-149 sshd[3858]: Invalid user ftpuser from 187.19.48.6
Feb 16 08:52:58 ip-172-31-19-149 sshd[3858]: input_userauth_request: invalid user ftpuser [preauth]
Feb 16 08:52:58 ip-172-31-19-149 sshd[3858]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:55:27 ip-172-31-19-149 sshd[3862]: Bad protocol version identification 'CONNECT 45.33.54.195:80 HTTP/1.0' from 124.158.15.114 port 59612
Feb 16 08:55:28 ip-172-31-19-149 sshd[3863]: Did not receive identification string from 124.158.15.114
Feb 16 08:55:28 ip-172-31-19-149 sshd[3864]: Did not receive identification string from 124.158.15.114
Feb 16 08:55:29 ip-172-31-19-149 sshd[3865]: Bad protocol version identification 'GET http://proxyjudge.us/judge.php HTTP/1.0' from 124.158.15.114 port 59777
Feb 16 08:55:30 ip-172-31-19-149 sshd[3860]: Invalid user download from 187.19.48.6
Feb 16 08:55:30 ip-172-31-19-149 sshd[3860]: input_userauth_request: invalid user download [preauth]
Feb 16 08:55:30 ip-172-31-19-149 sshd[3860]: Connection closed by 187.19.48.6 [preauth]
Feb 16 08:56:44 ip-172-31-19-149 sshd[3866]: Disconnecting: Too many authentication failures for root [preauth]

答案1

请仔细阅读输出。我认为问题不是文件夹而是登录。

debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /Users/emmet/Desktop/test.pem
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
**Permission denied (publickey)**.

我想说你的密钥被拒绝了。请验证

ssh -i /Users/emmet/Desktop/test.pem [email protected]

成功了。

编辑1: 您的权限不正确。

Feb 16 08:40:08 ip-172-31-19-149 sshd[3835]: Authentication refused: bad ownership or modes for file /home/ec2-user/.ssh/authorized_keys

这里了解更多信息。

相关内容