CentOS 7에서 SSH에 로그인할 수 없습니다. [닫기]

CentOS 7에서 SSH에 로그인할 수 없습니다. [닫기]

기존 CentOS 7 서버에서 새로 추가된 사용자 계정을 사용하여 SSH에 로그인할 수 없습니다. 비밀번호가 맞더라도 연결이 즉시 종료됩니다.

다음 PAM 오류가 기록됩니다 /var/log/secure.

Aug 17 12:01:24 server sshd[10972]: Accepted password for testaccount from 1.2.3.4 port 58648 ssh2
Aug 17 12:01:24 server sshd[10972]: pam_unix(sshd:session): session opened for user testaccount by (uid=0)
Aug 17 12:01:24 server sshd[10972]: error: PAM: pam_open_session(): Cannot make/remove an entry for the specified session

testaccount 사용자의 /bin/bash쉘은 다음과 같습니다:

[root@server /]# grep testaccount /etc/passwd
testaccount:x:10009:10009::/home/testaccount:/bin/bash

루트를 통한 SSH 액세스는 정상적으로 작동합니다.

출력 ls -ld / /home /home/testaccount:

dr-xr-xr-x. 17 root        root        4096 Jan  4  2017 /
drwxr-xr-x.  5 root        root          48 Aug 17 12:04 /home
drwx------   2 testaccount testaccount   59 Aug 17 12:04 /home/testaccount

출력 date; date --utc:

Thu Aug 17 14:34:02 EDT 2017
Thu Aug 17 18:34:02 UTC 2017

이 문제를 어떻게 해결할 수 있나요?

답변1

해결됨 - 다음 줄은 /etc/pam.d/system-authUID가 1000보다 큰 사용자에 대한 연결을 종료하는 것으로 나타났습니다.

auth        requisite     pam_succeed_if.so uid >= 1000 quiet_success

계정의 UID를 <1000으로 조정하면 문제가 해결되었습니다. 이 작업은 다음 명령을 사용하여 수행할 수 있습니다.

usermod -u 346 testaccount

관련 정보