SCPの動作が停止しました。権限が拒否されました。もう一度お試しください。

SCPの動作が停止しました。権限が拒否されました。もう一度お試しください。

scpを使用してサーバーAからBにファイルを転送しています。どちらもWHMを持つCentOSで、ユーザー名は同じです。

 nohup scp -rpC xaa2 username@serverIPB:xaa2

この作業を何度もしましたが、突然動作が停止しました! BからAに送信しようとしましたが、うまく機能し、入力したパスワードが正しいと確信しています。

実行すると、次のような結果が得られます。scp -v text.txt [email protected]:

Executing: program /usr/bin/ssh host mydomainB.com, user username, command scp -v -t .
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to mydomainB.com [serverIPB] port 22.
debug1: Connection established.
debug1: identity file /home/username/.ssh/identity type -1
debug1: identity file /home/username/.ssh/identity-cert type -1
debug1: identity file /home/username/.ssh/id_rsa type -1
debug1: identity file /home/username/.ssh/id_rsa-cert type -1
debug1: identity file /home/username/.ssh/id_dsa type -1
debug1: identity file /home/username/.ssh/id_dsa-cert type -1
debug1: identity file /home/username/.ssh/id_ecdsa type -1
debug1: identity file /home/username/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'mydomainB.com' is known and matches the RSA host key.
debug1: Found key in /home/username/.ssh/known_hosts:5
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure.  Minor code may provide more information
Credentials cache file '/tmp/krb5cc_501' not found

debug1: Unspecified GSS failure.  Minor code may provide more information
Credentials cache file '/tmp/krb5cc_501' not found

debug1: Unspecified GSS failure.  Minor code may provide more information    

debug1: Unspecified GSS failure.  Minor code may provide more information
Credentials cache file '/tmp/krb5cc_501' not found

debug1: Next authentication method: publickey
debug1: Trying private key: /home/comdinhe/.ssh/identity
debug1: Trying private key: /home/comdinhe/.ssh/id_rsa
debug1: Trying private key: /home/comdinhe/.ssh/id_dsa
debug1: Trying private key: /home/comdinhe/.ssh/id_ecdsa
debug1: Next authentication method: password
[email protected]'s password: 
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
Permission denied, please try again.

私は次のページを読んだ。

リンク1:sshdがデーモンの場合にのみ公開鍵認証が失敗する

リンク2:ssh ログインは成功しましたが、scp パスワードのため「権限が拒否されました」というメッセージが表示されます。

リンク3:scpを使用してファイルを転送するとき、「権限が拒否されました。もう一度お試しください」

リンク4:scpを使用したファイル転送中:権限が拒否されました。

リンク5:SSH経由のscpコピーは機能しません。権限拒否エラーです。わかりますか?

問題は似ているようですが、この問題が発生する理由はいくつかあります。私は試した:

  • sudoを使用したコマンドの実行:同じ問題
  • 実行:同じ問題ssh -v [email protected]
  • ユーザー名がディレクトリ宛先を所有しています。
  • 宛先ディレクトリに同じ名前のファイルがありません。

私を最も迷惑にするのは、それが実行中だったのをやめたということです。 ServerB は新しいサーバーであり、serverC を使用して serverB にファイルを送信する際に同じ問題が発生しました。しばらくするとアクセスをブロックしているようです。

編集する: 動作が停止する前後にログ(/var/log/secure)を選択してみました。

Mar 18 02:26:11 localhost sshd[56154]: Accepted password for username from ServerA_IP port 42219 ssh2
Mar 18 02:26:11 localhost sshd[56154]: pam_unix(sshd:session): session opened for user username by (uid=0)
Mar 18 02:32:57 localhost sshd[56363]: Connection closed by 115.239.228.16 <---- chinese IP
Mar 18 02:34:12 localhost sshd[56161]: Received disconnect from ServerA_IP: 11: disconnected by user
Mar 18 02:34:12 localhost sshd[56154]: pam_unix(sshd:session): session closed for user username
Mar 18 03:00:20 localhost sshd[58424]: Connection closed by 115.239.228.6 <---- chinese IP
Mar 18 03:21:35 localhost sshd[58922]: Accepted password for username from ServerA_IP port 42260 ssh2
Mar 18 03:21:35 localhost sshd[58922]: pam_unix(sshd:session): session opened for user username by (uid=0)

/**** lots of brute force attack from strangers*****/

Mar 18 05:18:01 localhost sshd[64459]: Failed password for username from ServerA_IP port 42362 ssh2
Mar 18 05:18:17 localhost sshd[64459]: Failed password for username from ServerA_IP port 42362 ssh2
Mar 18 05:18:17 localhost sshd[64462]: Connection closed by ServerA_IP
Mar 18 05:20:58 localhost sshd[64641]: Failed password for username from ServerA_IP port 42370 ssh2
Mar 18 05:21:01 localhost sshd[64644]: Connection closed by ServerA_IP
Mar 18 05:21:41 localhost sshd[64654]: Failed password for username from ServerA_IP port 42371 ssh2
Mar 18 05:21:43 localhost sshd[64657]: Connection closed by ServerA_IP

ベストアンサー1

おすすめ記事