su的時候報:could not open session
su的時候報:could not open session
新建立的使用者也不可以
使用者可以直接登入,但是報uid錯誤。
[root@XiMenFront ~]# useradd -g users -d /home/xxx -u 520 xxx
[root@XiMenFront ~]# su - xxx
could not open session
網上一位朋友的文章
Support wrote:
> I'm using RH 9, I could not su to other users besides root. when I do "su"
>
> [root@server] # su - user1
> could not open session
>
> If I do this directly from console:
> id: user1
> passwd:
>
> id: could not find name for uesr ID 1001
> id: could not find name for uesr ID 1001
> [I have no user1]$
> does any know about it? please advise.
>
1) Study the error messages in
# cat /var/log/messages (and possibly in /var/log/secure)
2) /etc/passwd and /etc/shadow files are propably OK.
Anyway, check the lines.
# grep user1 /etc/passwd /etc/shadow
3) Check file permissions
# ls -ld /etc /etc/passwd /etc/shadow /etc/pam.d
drwxr-xr-x 103 root root 12288 Mar 15 10:04 /etc
drwxr-xr-x 2 root root 4096 Mar 15 10:05 /etc/pam.d
-rw-r--r-- 1 root root 2623 Mar 15 09:50 /etc/passwd
-rw------- 1 root root 1588 Mar 15 09:52 /etc/shadow
(just note: /etc/shadow should always be -r-r--r--)
4) Maybe there is something wrong in "/etc/pam.d/su" file ?
# cat /etc/pam.d/su (note: this machine is Fedora-2 test)
#%PAM-1.0
auth sufficient /lib/security/$ISA/pam_rootok.so
auth required /lib/security/$ISA/pam_stack.so service=system-auth
account required /lib/security/$ISA/pam_stack.so service=system-auth
password required /lib/security/$ISA/pam_stack.so service=system-auth
session required /lib/security/$ISA/pam_stack.so service=system-auth
session optional /lib/security/$ISA/pam_selinux.so multiple
session optional /lib/security/$ISA/pam_xauth.so
檢視出錯的伺服器
vi /var/log/messages
Nov 15 18:01:51 XiMenFront su(pam_unix)[3303]: session opened for user informix by root(uid=0)
Nov 15 18:01:51 XiMenFront su[3303]: Warning! Could not relabel /dev/pts/2 with user_u:object_r:initrc_devpts_t,
not relabeling.Operation not permitted
執行操作
[root@XiMenFront ~]# ls -ld /etc /etc/passwd /etc/shadow /etc/pam.d
drwxr-xr-x 80 root root 12288 Nov 15 18:08 /etc
drwxr-xr-x 2 root root 4096 Nov 14 18:33 /etc/pam.d
-rw------- 1 root root 2180 Nov 15 18:08 /etc/passwd
-rw------- 1 root root 1435 Nov 15 18:08 /etc/shadow
發現許可權不對,
[root@XiMenFront ~]# chmod go+r /etc/passwd
[root@XiMenFront ~]# ls -ld /etc /etc/passwd /etc/shadow /etc/pam.d
drwxr-xr-x 80 root root 12288 Nov 15 18:08 /etc
drwxr-xr-x 2 root root 4096 Nov 14 18:33 /etc/pam.d
-rw-r--r-- 1 root root 2180 Nov 15 18:08 /etc/passwd
-rw------- 1 root root 1435 Nov 15 18:08 /etc/shadow
執行許可權後Ok
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/312079/viewspace-245524/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- su - root could not open sessionSession
- su - xxx Could not create sessionSession
- Linux su 切換到某使用者時報錯: could not open sessionLinuxSession
- 解決“su: cannot open session: Permission denied”Session
- WireMock 的時候報錯:No response could be served as there are no stub mappings in this WireMockREMMockAPP
- XIII Open Grodno SU Championship
- session是什麼時候建立的Session
- could not initialize proxy - no SessionSession
- session的狀態什麼時候是snipedSession
- open session in viewSessionView
- 什麼時候用有狀態session bean,什麼時候用無狀態session bean (轉)SessionBean
- mount iso檔案的時候提示Could not find any loop deviceOOPdev
- 求助:環境正常,xcodebuild 也執行成功了,但是使用 appium desktop 的時候,出現:Could not start sessionXCodeUIAPPSession
- open-falcon ---安裝Dashboard時候報錯"SSLError: The read operation timed out"Error
- 從32位資料庫還原到64bit資料庫open的時候報錯資料庫
- session_max_open_filesSession
- 請教open session in viewSessionView
- Open Session In View 探討SessionView
- Nginx報錯: "Too many open files accept" 和 "could not build the server_names_hash"NginxUIServer
- oracle 什麼時候才回收v$session 中status='KILLED'的程式OracleSession
- oracle 安裝的時候出現PRVF-0002 : could not retrieve local node nameOracle
- Many To Many could not initialize proxy – no Session的解決方法Session
- rsync 客戶端同步的時候報錯客戶端
- 執行dbca命令的時候報錯了
- vagrant下composer安裝laravel-wechat時候,出現could not delete的錯誤Laraveldelete
- open session in view引起的事務問題SessionView
- SESSION_CURSOR_CACHE open_cursorsSession
- su - oracle報錯su: cannot set user id: Resource temporarily unavailableOracleAI
- 誰遇到過執行 monkey 的時候報 filenotfound 的報錯
- php執行的時候報File size limit exceededPHPMIT
- informix初始化的時候報: semget: errno = 28ORM
- 物理data guard備standby庫的時候報錯。
- su和su - 的區別
- 錯誤記錄(八)could not initialize proxy - no SessionSession
- RMAN-06403: could not obtain a fully authorized sessionAIZedSession
- setInterval()呼叫其他函式時候報錯函式
- 解決vue使用Sass時候的報錯問題Vue
- mysql連線的時候報 ERROR 1129MySqlError