Azure에서 루트로 SSH 로그인

자첵 지아 비키

Microsoft Azure에서 실행되는 Linux VM에서 루트로 SSH 로그인을 활성화하려고합니다. VM은 Azure Marketplace의 Oracle Linux 6.4 이미지를 기반으로합니다.

공용 인증서 인증을 사용하여 사용자 루트로 VM에 SSH를 사용할 수 있기를 원합니다. 대상에 루트로 연결하는 rsync를 사용하여 Azure VM에 소프트웨어의 자동화 된 배포를 수행하려고하므로 sudo를 사용하는 대신 직접 루트 로그인이 필요합니다.

내가 시도한 것은 다음과 같습니다.

  1. authorized_keys 파일에 공개 키가 있고 일반 사용자로 암호없이 로그인 할 수 있지만 루트는 사용할 수 없습니다.
  2. 일반 사용자와 함께 작업 한 동일한 authorized_keys 파일이 /root/.ssh에 복사되었습니다. / root 및 /root/.ssh 디렉토리와 authorized_keys 파일은 모두 루트가 소유하며 다른 사람이 쓸 수 없습니다.
  3. 나는 설정했다

    PermitRootLogin yes
    

    / etc / ssh / sshd_config에서 sshd를 다시 시작하고 VM을 재부팅했습니다.

  4. 루트로 연결할 때 "서버가 키를 거부했습니다"라는 메시지가 나타납니다. 비밀번호 인증을 사용하여 루트로 SSH 로그인을 성공적으로 활성화했으며 비밀번호를 사용하여 루트로 로그인 할 수있었습니다.

    Using username "root".
    Server refused our key
    Using keyboard-interactive authentication.
    Password:
    [root@myazureserver ~]#
    
  5. 다른 포트에서 디버그 모드에서 sshd의 두 번째 인스턴스를 시작했습니다.

    [root@myazureserver ~]# /usr/sbin/sshd -Dd -p 2020
    debug1: sshd version OpenSSH_5.3p1
    debug1: read PEM private key done: type RSA
    debug1: private host key: #0 type 1 RSA
    debug1: read PEM private key done: type DSA
    debug1: private host key: #1 type 2 DSA
    debug1: rexec_argv[0]='/usr/sbin/sshd'
    debug1: rexec_argv[1]='-Dd'
    debug1: rexec_argv[2]='-p'
    debug1: rexec_argv[3]='2020'
    Set /proc/self/oom_score_adj from 0 to -1000
    debug1: Bind to port 2020 on 0.0.0.0.
    Server listening on 0.0.0.0 port 2020.
    debug1: Bind to port 2020 on ::.
    Server listening on :: port 2020.
    

    sshd의 디버그 인스턴스 (포트 2020)에 연결할 때 암호없이 루트로 로그인 할 수 있습니다. 공개 키를 수락합니다!

  6. Windows에서 SSH 클라이언트로 PuTTY를 사용하는 대신 동일한 VM에서 ssh 명령을 사용해 보았습니다 (일반 사용자로 로그인했을 때). 암호없이 SSH를 통해 한 일반 사용자 계정에서 다른 계정으로 로그인 할 수 있었지만 일반 계정에서 루트 계정으로 로그인 할 수 없었습니다. 다음은 디버그 모드에서 실행되는 ssh의 출력이며 루트로 연결합니다.

    [oracle@myazureserver ~]$ ssh -vvv root@myazureserver
    OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to myazureserver [10.0.0.4] port 22.
    debug1: Connection established.
    debug1: identity file /home/oracle/.ssh/identity type -1
    debug3: Not a RSA1 key file /home/oracle/.ssh/id_rsa.
    debug2: key_type_from_name: unknown key type '-----BEGIN'
    debug3: key_read: missing keytype
    debug3: key_read: missing whitespace
    ...
    debug3: key_read: missing whitespace
    debug2: key_type_from_name: unknown key type '-----END'
    debug3: key_read: missing keytype
    debug1: identity file /home/oracle/.ssh/id_rsa type 1
    debug1: identity file /home/oracle/.ssh/id_dsa 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
    debug2: fd 3 setting O_NONBLOCK
    debug1: SSH2_MSG_KEXINIT sent
    debug3: Wrote 792 bytes for a total of 813
    debug1: SSH2_MSG_KEXINIT received
    debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
    debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,[email protected],zlib
    debug2: kex_parse_kexinit: none,[email protected],zlib
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit: first_kex_follows 0
    debug2: kex_parse_kexinit: reserved 0
    debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
    debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,[email protected]
    debug2: kex_parse_kexinit: none,[email protected]
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit: first_kex_follows 0
    debug2: kex_parse_kexinit: reserved 0
    debug2: mac_setup: found hmac-md5
    debug1: kex: server->client aes128-ctr hmac-md5 none
    debug2: mac_setup: found hmac-md5
    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
    debug3: Wrote 24 bytes for a total of 837
    debug2: dh_gen_key: priv key bits set: 128/256
    debug2: bits set: 512/1024
    debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
    debug3: Wrote 144 bytes for a total of 981
    debug3: check_host_in_hostfile: filename /home/oracle/.ssh/known_hosts
    debug3: check_host_in_hostfile: match line 1
    debug3: check_host_in_hostfile: filename /home/oracle/.ssh/known_hosts
    debug3: check_host_in_hostfile: match line 1
    debug1: Host 'myazureserver' is known and matches the RSA host key.
    debug1: Found key in /home/oracle/.ssh/known_hosts:1
    debug2: bits set: 507/1024
    debug1: ssh_rsa_verify: signature correct
    debug2: kex_derive_keys
    debug2: set_newkeys: mode 1
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug3: Wrote 16 bytes for a total of 997
    debug2: set_newkeys: mode 0
    debug1: SSH2_MSG_NEWKEYS received
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug3: Wrote 48 bytes for a total of 1045
    debug2: service_accept: ssh-userauth
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug2: key: /home/oracle/.ssh/identity ((nil))
    debug2: key: /home/oracle/.ssh/id_rsa (0x7f81f3a5dd70)
    debug2: key: /home/oracle/.ssh/id_dsa ((nil))
    debug3: Wrote 64 bytes for a total of 1109
    debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password,keyboard-interactive
    debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic,password,keyboard-interactive
    debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
    debug3: authmethod_lookup gssapi-keyex
    debug3: remaining preferred: gssapi-with-mic,publickey,keyboard-interactive,password
    debug3: authmethod_is_enabled gssapi-keyex
    debug1: Next authentication method: gssapi-keyex
    debug1: No valid Key exchange context
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup gssapi-with-mic
    debug3: remaining preferred: publickey,keyboard-interactive,password
    debug3: authmethod_is_enabled gssapi-with-mic
    debug1: Next authentication method: gssapi-with-mic
    debug3: Trying to reverse map address 10.0.0.4.
    debug1: Unspecified GSS failure.  Minor code may provide more information
    Credentials cache file '/tmp/krb5cc_54321' not found
    
    debug1: Unspecified GSS failure.  Minor code may provide more information
    Credentials cache file '/tmp/krb5cc_54321' 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_54321' not found
    
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup publickey
    debug3: remaining preferred: keyboard-interactive,password
    debug3: authmethod_is_enabled publickey
    debug1: Next authentication method: publickey
    debug1: Trying private key: /home/oracle/.ssh/identity
    debug3: no such identity: /home/oracle/.ssh/identity
    debug1: Offering public key: /home/oracle/.ssh/id_rsa
    debug3: send_pubkey_test
    debug2: we sent a publickey packet, wait for reply
    debug3: Wrote 368 bytes for a total of 1477
    debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password,keyboard-interactive
    debug1: Trying private key: /home/oracle/.ssh/id_dsa
    debug3: no such identity: /home/oracle/.ssh/id_dsa
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup keyboard-interactive
    debug3: remaining preferred: password
    debug3: authmethod_is_enabled keyboard-interactive
    debug1: Next authentication method: keyboard-interactive
    debug2: userauth_kbdint
    debug2: we sent a keyboard-interactive packet, wait for reply
    debug3: Wrote 96 bytes for a total of 1573
    debug2: input_userauth_info_req
    debug2: input_userauth_info_req: num_prompts 1
    Password:
    

    다음은 일반 사용자로 연결하는 ssh의 출력입니다.

    [oracle@myazureserver ~]$ ssh -vvv jziabick@myazureserver
    OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to myazureserver [10.0.0.4] port 22.
    debug1: Connection established.
    debug1: identity file /home/oracle/.ssh/identity type -1
    debug3: Not a RSA1 key file /home/oracle/.ssh/id_rsa.
    debug2: key_type_from_name: unknown key type '-----BEGIN'
    debug3: key_read: missing keytype
    debug3: key_read: missing whitespace
    ...
    debug3: key_read: missing whitespace
    debug2: key_type_from_name: unknown key type '-----END'
    debug3: key_read: missing keytype
    debug1: identity file /home/oracle/.ssh/id_rsa type 1
    debug1: identity file /home/oracle/.ssh/id_dsa 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
    debug2: fd 3 setting O_NONBLOCK
    debug1: SSH2_MSG_KEXINIT sent
    debug3: Wrote 792 bytes for a total of 813
    debug1: SSH2_MSG_KEXINIT received
    debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
    debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,[email protected],zlib
    debug2: kex_parse_kexinit: none,[email protected],zlib
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit: first_kex_follows 0
    debug2: kex_parse_kexinit: reserved 0
    debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
    debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
    debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
    debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected]
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
    debug2: kex_parse_kexinit: none,[email protected]
    debug2: kex_parse_kexinit: none,[email protected]
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit:
    debug2: kex_parse_kexinit: first_kex_follows 0
    debug2: kex_parse_kexinit: reserved 0
    debug2: mac_setup: found hmac-md5
    debug1: kex: server->client aes128-ctr hmac-md5 none
    debug2: mac_setup: found hmac-md5
    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
    debug3: Wrote 24 bytes for a total of 837
    debug2: dh_gen_key: priv key bits set: 119/256
    debug2: bits set: 535/1024
    debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
    debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
    debug3: Wrote 144 bytes for a total of 981
    debug3: check_host_in_hostfile: filename /home/oracle/.ssh/known_hosts
    debug3: check_host_in_hostfile: match line 1
    debug3: check_host_in_hostfile: filename /home/oracle/.ssh/known_hosts
    debug3: check_host_in_hostfile: match line 1
    debug1: Host 'myazureserver' is known and matches the RSA host key.
    debug1: Found key in /home/oracle/.ssh/known_hosts:1
    debug2: bits set: 529/1024
    debug1: ssh_rsa_verify: signature correct
    debug2: kex_derive_keys
    debug2: set_newkeys: mode 1
    debug1: SSH2_MSG_NEWKEYS sent
    debug1: expecting SSH2_MSG_NEWKEYS
    debug3: Wrote 16 bytes for a total of 997
    debug2: set_newkeys: mode 0
    debug1: SSH2_MSG_NEWKEYS received
    debug1: SSH2_MSG_SERVICE_REQUEST sent
    debug3: Wrote 48 bytes for a total of 1045
    debug2: service_accept: ssh-userauth
    debug1: SSH2_MSG_SERVICE_ACCEPT received
    debug2: key: /home/oracle/.ssh/identity ((nil))
    debug2: key: /home/oracle/.ssh/id_rsa (0x7f2ae500fd70)
    debug2: key: /home/oracle/.ssh/id_dsa ((nil))
    debug3: Wrote 64 bytes for a total of 1109
    debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password,keyboard-interactive
    debug3: start over, passed a different list publickey,gssapi-keyex,gssapi-with-mic,password,keyboard-interactive
    debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
    debug3: authmethod_lookup gssapi-keyex
    debug3: remaining preferred: gssapi-with-mic,publickey,keyboard-interactive,password
    debug3: authmethod_is_enabled gssapi-keyex
    debug1: Next authentication method: gssapi-keyex
    debug1: No valid Key exchange context
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup gssapi-with-mic
    debug3: remaining preferred: publickey,keyboard-interactive,password
    debug3: authmethod_is_enabled gssapi-with-mic
    debug1: Next authentication method: gssapi-with-mic
    debug3: Trying to reverse map address 10.0.0.4.
    debug1: Unspecified GSS failure.  Minor code may provide more information
    Credentials cache file '/tmp/krb5cc_54321' not found
    
    debug1: Unspecified GSS failure.  Minor code may provide more information
    Credentials cache file '/tmp/krb5cc_54321' 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_54321' not found
    
    debug2: we did not send a packet, disable method
    debug3: authmethod_lookup publickey
    debug3: remaining preferred: keyboard-interactive,password
    debug3: authmethod_is_enabled publickey
    debug1: Next authentication method: publickey
    debug1: Trying private key: /home/oracle/.ssh/identity
    debug3: no such identity: /home/oracle/.ssh/identity
    debug1: Offering public key: /home/oracle/.ssh/id_rsa
    debug3: send_pubkey_test
    debug2: we sent a publickey packet, wait for reply
    debug3: Wrote 368 bytes for a total of 1477
    debug1: Server accepts key: pkalg ssh-rsa blen 279
    debug2: input_userauth_pk_ok: SHA1 fp b6:aa:fd:7b:bf:d2:99:78:48:38:cc:9e:b0:26:05:dc:1c:4e:83:35
    debug3: sign_and_send_pubkey
    debug1: read PEM private key done: type RSA
    debug3: Wrote 640 bytes for a total of 2117
    debug1: Authentication succeeded (publickey).
    debug1: channel 0: new [client-session]
    debug3: ssh_session2_open: channel_new: 0
    debug2: channel 0: send open
    debug1: Requesting [email protected]
    debug1: Entering interactive session.
    debug3: Wrote 128 bytes for a total of 2245
    debug2: callback start
    debug2: client_session2_setup: id 0
    debug2: channel 0: request pty-req confirm 1
    debug1: Sending environment.
    debug3: Ignored env HOSTNAME
    debug3: Ignored env SELINUX_ROLE_REQUESTED
    debug3: Ignored env TERM
    debug3: Ignored env SHELL
    debug3: Ignored env HISTSIZE
    debug3: Ignored env SSH_CLIENT
    debug3: Ignored env SELINUX_USE_CURRENT_RANGE
    debug3: Ignored env SSH_TTY
    debug3: Ignored env USER
    debug3: Ignored env LS_COLORS
    debug3: Ignored env MAIL
    debug3: Ignored env PATH
    debug3: Ignored env PWD
    debug1: Sending env LANG = en_US.UTF-8
    debug2: channel 0: request env confirm 0
    debug3: Ignored env SELINUX_LEVEL_REQUESTED
    debug3: Ignored env HISTCONTROL
    debug3: Ignored env SHLVL
    debug3: Ignored env HOME
    debug3: Ignored env LOGNAME
    debug3: Ignored env SSH_CONNECTION
    debug3: Ignored env LESSOPEN
    debug3: Ignored env G_BROKEN_FILENAMES
    debug3: Ignored env _
    debug2: channel 0: request shell confirm 1
    debug2: fd 3 setting TCP_NODELAY
    debug2: callback done
    debug2: channel 0: open confirm rwindow 0 rmax 32768
    debug3: Wrote 448 bytes for a total of 2693
    debug2: channel_input_status_confirm: type 99 id 0
    debug2: PTY allocation request accepted on channel 0
    debug2: channel 0: rcvd adjust 2097152
    debug2: channel_input_status_confirm: type 99 id 0
    debug2: shell request accepted on channel 0
    

편집-아래의 추가 로그 파일 정보. / var / log / secure에서 성공적인 로그인에 대해 다음과 같이 표시됩니다.

Mar 17 18:55:09 myazureserver sshd[1196]: Server listening on :: port 22.
Mar 17 19:08:18 myazureserver sshd[1383]: Accepted publickey for jziabick from xx.xx.xx.xx port 53533 ssh2
Mar 17 19:08:19 myazureserver sshd[1383]: pam_unix(sshd:session): session opened for user jziabick by (uid=0)

실패한 로그인 (루트)의 경우 / var / log / secure에서 볼 수 있습니다.

Mar 18 10:52:24 myazureserver sshd[1992]: Server listening on :: port 22.
Mar 18 10:53:02 myazureserver sshd[1997]: Received disconnect from xx.xx.xx.xx: 14: No supported authentication methods available

/var/log/audit/audit.log에서 찾았습니다 (루트로 로그인하지 못한 경우).

type=AVC msg=audit(1458311548.677:733): avc:  denied  { read } for  pid=1948 comm="sshd" name="authorized_keys" dev=sda3 ino=259748 scontext=system_u:system_r:sshd_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:admin_home_t:s0 tclass=file
type=SYSCALL msg=audit(1458311548.677:733): arch=c000003e syscall=2 success=no exit=-13 a0=7f8c6621d470 a1=800 a2=1 a3=4 items=0 ppid=1196 pid=1948 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="sshd" exe="/usr/sbin/sshd" subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 key=(null)
type=USER_AUTH msg=audit(1458311548.679:734): user pid=1948 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 msg='op=pubkey acct="root" exe="/usr/sbin/sshd" hostname=? addr=xx.xx.xx.xx terminal=ssh res=failed'
type=USER_AUTH msg=audit(1458311668.148:735): user pid=1950 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:sshd_t:s0-s0:c0.c1023 msg='op=PAM:authentication acct="root" exe="/usr/sbin/sshd" hostname=c-xx-xx-xx-xx.hsd1.il.comcast.net addr=xx.xx.xx.xx terminal=ssh res=failed'

내가 무엇을 놓치고 있습니까? Oracle Linux (루트로 로그인 포함)에서 공개 키 인증으로 SSH 설정을 여러 번 수행했습니다. 이는 Azure 구성과 관련된 것이어야합니다.

야키

SELinux를 비난 할 수 있습니다. authorized_keys파일 레이블이 잘못 지정되었습니다 (다른 파일 일 수도 있음).

type = AVC msg = audit (1458311548.677 : 733) : avc : 거부 됨 {읽기} for pid = 1948 comm = "sshd"name = "authorized_keys"dev = sda3 ino = 259748 scontext = system_u : system_r : sshd_t : s0-s0 : c0.c1023 tcontext = unconfined_u : object_r : admin_home_t : s0 tclass = file

안전한 해결책은 레이블을 다시 지정하는 것입니다 /root/.

restorecon -rf /root/

또는 도움이되지 않는 경우 해당 특정 파일의 레이블을 수정하십시오.

chcon -t ssh_home_t /root/.ssh/authorized_keys

그렇게해야합니다. 그렇지 않은 경우 현재 결과로 질문을 업데이트하십시오 ( AVC감사 메시지가 일반적으로 유용함).

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

모든 SSH 로그인에서 루트로 스크립트 실행

분류에서Dev

스크립트 ssh 서버에 로그인하고 루트 암호 전달

분류에서Dev

ssh 및 로컬 루트 로그인이 Debian 9에서 잘못된 암호로 작동합니다.

분류에서Dev

ssh_config에 PermitRootLogin이 누락 된 Debian 8.3 새로 설치 (루트 로그인을 ssh 할 수 없음)

분류에서Dev

서버에서 루트로 원격 SSH 로그인을 비활성화하려면 어떻게합니까?

분류에서Dev

서버에서 루트로 원격 SSH 로그인을 비활성화하려면 어떻게합니까?

분류에서Dev

루트 SSH 로그인을 거부하는 방법 + 사용자에게 SSH 키가 필요합니까?

분류에서Dev

ZFS는 루트 로그인을 허용하지 않고 Linux에서 ssh를 통해 송수신

분류에서Dev

Azure bitnami 서버에 대한 올바른 SSH 로그인 및 명령

분류에서Dev

Azure bitnami 서버에 대한 올바른 SSH 로그인 및 명령

분류에서Dev

쉘 스크립트에서 SSH 로그인 후 날짜 변경

분류에서Dev

Debian에서 SSH 로그인시 MOTD 업데이트

분류에서Dev

SSH 서버에 로그인하기위한 쉘 스크립트

분류에서Dev

루트 로그인으로 SSH-GoDaddy VPS

분류에서Dev

서버, 원격 로그인, SSH?

분류에서Dev

서버, 원격 로그인, SSH?

분류에서Dev

로그인 쉘에 ssh + sudo + su

분류에서Dev

ssh : 로그인 전에 명령 실행

분류에서Dev

ssh : 로그인 전에 명령 실행

분류에서Dev

vps 문제에 SSH 키 로그인

분류에서Dev

루트가 아닌 다른 사람으로 서버에 로그인 할 때 SSH를 통한 경로 또는 명령 기록 없음

분류에서Dev

로그인 시나리오 및 루트 SSH 액세스 블록

분류에서Dev

ssh를 통한 원격 루트 로그인

분류에서Dev

ssh 로그인 실패에 대한 로그 암호

분류에서Dev

ssh에 두 번 로그인하는 스크립트

분류에서Dev

ssh에서 개인 IP로

분류에서Dev

ssh에서 개인 IP로

분류에서Dev

라즈베리 파이에서 사용자 이름과 권한을 망 쳤지 만 여전히 ssh를 통해 루트로 로그인했습니다.

분류에서Dev

변경된 SSH 포트로 SSH 인증 키로 로그인

Related 관련 기사

  1. 1

    모든 SSH 로그인에서 루트로 스크립트 실행

  2. 2

    스크립트 ssh 서버에 로그인하고 루트 암호 전달

  3. 3

    ssh 및 로컬 루트 로그인이 Debian 9에서 잘못된 암호로 작동합니다.

  4. 4

    ssh_config에 PermitRootLogin이 누락 된 Debian 8.3 새로 설치 (루트 로그인을 ssh 할 수 없음)

  5. 5

    서버에서 루트로 원격 SSH 로그인을 비활성화하려면 어떻게합니까?

  6. 6

    서버에서 루트로 원격 SSH 로그인을 비활성화하려면 어떻게합니까?

  7. 7

    루트 SSH 로그인을 거부하는 방법 + 사용자에게 SSH 키가 필요합니까?

  8. 8

    ZFS는 루트 로그인을 허용하지 않고 Linux에서 ssh를 통해 송수신

  9. 9

    Azure bitnami 서버에 대한 올바른 SSH 로그인 및 명령

  10. 10

    Azure bitnami 서버에 대한 올바른 SSH 로그인 및 명령

  11. 11

    쉘 스크립트에서 SSH 로그인 후 날짜 변경

  12. 12

    Debian에서 SSH 로그인시 MOTD 업데이트

  13. 13

    SSH 서버에 로그인하기위한 쉘 스크립트

  14. 14

    루트 로그인으로 SSH-GoDaddy VPS

  15. 15

    서버, 원격 로그인, SSH?

  16. 16

    서버, 원격 로그인, SSH?

  17. 17

    로그인 쉘에 ssh + sudo + su

  18. 18

    ssh : 로그인 전에 명령 실행

  19. 19

    ssh : 로그인 전에 명령 실행

  20. 20

    vps 문제에 SSH 키 로그인

  21. 21

    루트가 아닌 다른 사람으로 서버에 로그인 할 때 SSH를 통한 경로 또는 명령 기록 없음

  22. 22

    로그인 시나리오 및 루트 SSH 액세스 블록

  23. 23

    ssh를 통한 원격 루트 로그인

  24. 24

    ssh 로그인 실패에 대한 로그 암호

  25. 25

    ssh에 두 번 로그인하는 스크립트

  26. 26

    ssh에서 개인 IP로

  27. 27

    ssh에서 개인 IP로

  28. 28

    라즈베리 파이에서 사용자 이름과 권한을 망 쳤지 만 여전히 ssh를 통해 루트로 로그인했습니다.

  29. 29

    변경된 SSH 포트로 SSH 인증 키로 로그인

뜨겁다태그

보관