解決ssh登入報錯-bash fork retry Resource temporarily unavailable

來源:互聯網
上載者:User

解決ssh登入報錯-bash fork retry Resource temporarily unavailable

SSH用非root使用者登入報錯,bash fork retry Resource temporarily unavailable。

引起該問題的原因可能是/etc/security/limits.d/90-nproc.conf檔案中nproc達到了上限,或者上述設定檔只針對特定使用者放開了限制,而其它使用者依然還有限制。

這裡的90-nproc.conf,可能會因機器而已。

解決方案是修改nproc上限或者修改對應的使用者賬戶,然後重啟系統生效即可。

註:此檔案是CentOS 6版本後才後該檔案,在CentOS 5.10中沒有

執行步驟如下:

1.cp-a /etc/security/limits.d/90-nproc.conf /etc/security/limits.d/90-nproc.conf.bak

註:此操作是備份檔案,避免操作失誤,可以用來還原。

2.vim/etc/security/limits.d/90-nproc.conf

#Default limit for number of user's processes to prevent

#accidental fork bombs.

#See rhbz #432903 for reasoning.

* soft nproc 1024

在此處將1024修改為更大的數值,根據需求設定即可,例如設定為:1500

#Default limit for number of user's processes to prevent

#accidental fork bombs.

#See rhbz #432903 for reasoning.

* soft nproc 1500

如果是針對特定使用者有限制,則修改對應的行內容即可,例如將:

#Default limit for number of user's processes to prevent

#accidental fork bombs.

#See rhbz #432903 for reasoning.

mayun soft nproc 1024

* soft nproc 1500

修改為:

#Default limit for number of user's processes to prevent

#accidental fork bombs.

#See rhbz #432903 for reasoning.

mayun soft nproc 2000

* soft nproc 1500

3.init 6

註:重啟系統

另外,如果這樣沒有作用,那就可以kill這個使用者的一些進程試試,如果可以,就是這個使用者的某個進程有迴圈,一直在佔用一些資源。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.