CentOS 6/Linux su: 無法設定使用者ID: 資源暫時不可用

來源:互聯網
上載者:User

標籤:linux   su   centos6   資源暫時不可用   

系統內容:CentOS 6.5

今天在使用su切換使用者doiido的的時候,出現了如下報錯:
# su - doiido
su: 無法設定使用者ID: 資源暫時不可用

同時使用SecureCRT等遠程SSH工具均無法使用doiido使用者串連。
尋找相關資料,發現是在CentOS 6中,存在/etc/security/limits.d/90-nproc.config檔案,此檔案限制了普通許可權使用者的最大線程數,當此使用者的最大線程數max user processes到達最高限制數,就無法串連登入。因此在無法減少線程的情況下只能修改此參數,具體修改方法如下:

1、查看max user processes

# su - doiido

su: 無法設定使用者ID: 資源暫時不可用

# ulimit -u
1024

由此可以看出最大線程數為1024



2、修改max user processes
# vi /etc/security/limits.d/90-nproc.conf
*          soft    nproc     1024
root       soft    nproc     unlimited

上面可以看除了root使用者外的所有使用者均限制為1024,因此通過可以注釋此行或者將值改大來解決該問題
修改完成後儲存退出,這樣的修改是立馬生效的(經測試成功)



3、還可以通過修改/etc/security/limits.conf檔案,修改結果如下
# cat /etc/security/limits.conf
doiido soft nproc 2047
doiido hard nproc 16384
doiido soft nofile 1024
doiido hard nofile 65535

註:在CentOS 5中無此檔案

CentOS 6/Linux su: 無法設定使用者ID: 資源暫時不可用

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.