我如何恢复 /etc/security/limits.conf?

我如何恢复 /etc/security/limits.conf?

我正在使用 Ubuntu 16.04,我不小心删除了整个 limits.conf 条目。有什么方法可以恢复它吗?

答案1

在我的系统上,/etc/security/limits.conf是软件包的一部分libpam-modules:amd64

$ dpkg -S /etc/security/limits.conf
libpam-modules:amd64: /etc/security/limits.conf

我已经安装了以下软件包:

$ dpkg -l libpam\*| grep -Ev '^un'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                       Version                Architecture Description
+++-==========================-======================-============-==========================================================
ii  libpam-cgfs                2.0.8-0ubuntu1~16.04.2 amd64        PAM module for managing cgroups for LXC
ii  libpam-gnome-keyring:amd64 3.18.3-0ubuntu2        amd64        PAM module to unlock the GNOME keyring upon login
ii  libpam-modules:amd64       1.1.8-3.2ubuntu2       amd64        Pluggable Authentication Modules for PAM
ii  libpam-modules-bin         1.1.8-3.2ubuntu2       amd64        Pluggable Authentication Modules for PAM - helper binaries
ii  libpam-runtime             1.1.8-3.2ubuntu2       all          Runtime support for the PAM library
ii  libpam-systemd:amd64       229-4ubuntu21.2        amd64        system and service manager - PAM module
ii  libpam0g:amd64             1.1.8-3.2ubuntu2       amd64        Pluggable Authentication Modules library

所以我会重新安装libpam-modules:amd64

sudo apt-get install --reinstall libpam-modules:amd64

由于我的系统可能与您的不同,所以我必须说YMMV

相关内容