天天看點

The following problem occurred during the use of su command in Centos: "cannot open session: Permiss

centos su - 使用者名 su: cannot open session: Permission denied

剛才用文章CentOS建立sudo使用者建立了一個賬号lwk,然後用

su - lwk

指令的時候報錯了。

-bash-4.2$ su - lwk
Password: 
Last failed login: Thu Jun 28 15:39:52 CST 2018 from 36.24.223.44 on ssh:notty
There was 1 failed login attempt since the last successful login.
su: cannot open session: Permission denied
-bash-4.2$
           

經多方查找,終于解決了通路題。解決思路如下:

編輯檔案/etc/security/limits.conf,在檔案末尾追加如下内容:

lwk soft nofile 65535
lwk hard nofile 65535
           

其中,lwk是打算用

su - lwk

指令進行切換使用者的使用者名。

參考文獻:

  • Centos Docker container su: cannot open session: Permission denied
  • linux使用者登陸顯示:could not open session
  • Unable to su into an account: could not open session
  • Running “su” Returns the Error “could not open session”

繼續閱讀