ヘッドノードのユーザー/homeディレクトリがクラスタ内のすべてのシステムで/homeにマウントされているクラスタでパスワードレス認証を設定する方法

ヘッドノードのユーザー/homeディレクトリがクラスタ内のすべてのシステムで/homeにマウントされているクラスタでパスワードレス認証を設定する方法

まず、助けてくれてありがとう。

タイトルが意味があることを願っています。デフォルトでは、ヘッドノードでは、ユーザーのホームディレクトリ(headnode:/home/ericなど)がNFS共有され、すべてのシステムの/homeディレクトリ(node01:/home/ericなど)にマウントされます。 SSHなしで設定しようとしています。暗号化ヘッドノードのすべてのユーザーとクラスタ内のすべてのシステム間の接続。これが私が今までやってきたことですが、うまく動作しないようです。

ヘッドノードとクラスタ内のすべてのコンピュータでCentOS 7を実行しています。

ヘッドノードの/homeをクラスタ内のすべてのシステムの/homeにマウントします。ヘッドノードでは、/etc/exports は次のようになります。

/home    *(rw,sync,no_root_squash,no_all_squash)

ユーザーericのヘッドノードからRSAキーを生成しました。

eric@headnode $: ssh-keygen -t rsa 

パスワードなし。

その後、Ericのアカウントにログインできるキーのリストに公開キーを追加しました。

cat id_rsa.pub >> authorized_keys

また、次の行を使用して/home/eric/.sshに "config"ファイルを作成しました。

StrictHostKeyChecking no
UserKnownHostsFile /dev/null

また、反映するように/etc/ssh/ssh_configを編集しました。

StrictHostKeyChecking no

ヘッドノードの/home/eric/id_rsa.pubキーと/home/eric/authorized_keysおよび/home/eric/authorized_keysの/home/eric/id_rsa.pubキーがマシン。ヘッドノードの/home/ericがクラスタ内のすべてのシステムの/home/ericにマウントされるため、同じです。

また、ヘッドノードの/home/eric/.ssh、クラスタのマシン、および.ssh内のファイルに対する権限が適切であることを確認しました。

~/.ssh/  700
~/.ssh/authorized_keys  600
~/.ssh/config   600
~/.ssh/id_rsa  600
~/.ssh/id_rsa.pub 644

これらの手順をすべて実行した後も、ヘッドノードとクラスタ内のコンピュータ間にパスワードのないSSH接続を確立できません。

ヘッドノードからクラスタ内のノードにsshを実行する際の詳細なログは次のとおりです。

    OpenSSH_7.4p1, OpenSSL 1.0.2k-fips  26 Jan 2017
debug1: Reading configuration data /home/eric/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug1: Connecting to tq3 [10.112.0.14] port 22.
debug1: Connection established.
debug1: identity file /home/eric/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/eric/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/eric/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/eric/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/eric/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/eric/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/eric/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/eric/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4
debug1: match: OpenSSH_7.4 pat OpenSSH* compat 0x04000000
debug1: Authenticating to tq3:22 as 'eric'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
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: kex: curve25519-sha256 need=64 dh_need=64
debug1: kex: curve25519-sha256 need=64 dh_need=64
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:M8Z5sDopU8J8sEkr9dkAwnIUbhcnLSKZjLfn5RykKA0
Warning: Permanently added 'tq3,10.112.0.14' (ECDSA) to the list of known hosts.
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
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
No Kerberos credentials available (default cache: KEYRING:persistent:1000)

debug1: Unspecified GSS failure.  Minor code may provide more information
No Kerberos credentials available (default cache: KEYRING:persistent:1000)

debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/eric/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: /home/eric/.ssh/id_dsa
debug1: Trying private key: /home/eric/.ssh/id_ecdsa
debug1: Trying private key: /home/eric/.ssh/id_ed25519
debug1: Next authentication method: password

何か構成を見逃したり逃したのですか?

みんなの助けに感謝します。

エリック

ベストアンサー1

ヘッドノードからすべてのコンピューティングノードへのパスワードなしのSSH接続を確立します。

  1. ユーザー/hone/user/.sshがいることを確認してください。ディレクトリが作成されていない場合は、.ssh次のコマンドを実行します。

    ssh-keygen
    
  2. ディレクトリ.sshが存在する場合と存在しないid_rsa場合があります。 id_rsa.pub キーをid_rsa.pub生成するには、次のコマンドを実行します。id_rsa

    ssh-keygen
    

    空のパスワードを入力するには、Enterを押します。ヘッドノードとコンピューティングノード間のSSH接続がパスワードで保護されている場合、SSH接続は失敗します。

  3. 公開鍵をターゲットホストにエクスポート

    ssh-copy-id user@node_in_your_cluster
    
  4. SSHパスワードなしの接続テスト

    ssh user@node_in_your_cluster
    
  5. 他のコンピューティングノードへのパスワードなしのSSH接続をテストします。接続を受け入れるように求められます。

おすすめ記事