Skip to content

Instantly share code, notes, and snippets.

@chapmanjacobd
Last active August 7, 2024 15:46
Show Gist options
  • Select an option

  • Save chapmanjacobd/8e245deb0e051d9cc77b3cfdbb215142 to your computer and use it in GitHub Desktop.

Select an option

Save chapmanjacobd/8e245deb0e051d9cc77b3cfdbb215142 to your computer and use it in GitHub Desktop.
fixing /etc/security/limits.conf without rebooting
sudoedit /etc/security/limits.conf
# 9223372036854775807 LOL ulimit -n unlimited ?! the max might be 1048576 or 1073741816 but you should just leave this file blank unless you have multiple users that access the system
oops...
sudo: pam_open_session: Permission denied
sudo: policy plugin failed session initialization
Segmentation fault (core dumped)
... terminated by signal SIGSEGV (Address boundary error)
Authorization not available. Check if polkit service is running or see debug message for more information.
sudo: policy plugin failed session initialization
Error getting authority: Error initializing authority: Error calling StartServiceByName for org.freedesktop.PolicyKit1: Timeout was reached
PAM might be broken but as long as polkit works, even if you don't have the root account enabled (you only have the wheel group),
you can still use systemd-run to recover sudo:
systemd-run sh -c "cat fixed.conf > /etc/security/limits.conf"
# booyah~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment