Quick Tip: No Need to Restart After Adding Yourself to a Group in Linux
When you add yourself to a group in Linux, like the Docker group, most tutorials and guides suggest that you log out or restart your system. However, there’s a much faster way to re-login without needing a reboot or re-login.
For example, when adding yourself to the Docker group:
$ sudo usermod -a -G docker $USER
Instead of restarting or logging out, you can use this command to refresh your session instantly:
$ su your_username -
And that's it! You’ve effectively re-logged into the terminal and can continue working with your new group permissions.
Cheers!