헤드 노드의 사용자 /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 연결을 테스트합니다. 연결을 수락하라는 메시지가 표시됩니다.

관련 정보