Quick Tip: No Need to Restart After Adding Yourself to a Group in Linux

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!

要查看或添加评论,请登录

Rafa Gomes的更多文章

  • Why I Fell in Love with NixOS

    Why I Fell in Love with NixOS

    Everyone who knows me well understands how passionate I am about Linux. After all, I use Linux 99% of the time since I…

  • Why I Prefer Snowflake IDs Over UUIDs (And You Might Want To, Too)

    Why I Prefer Snowflake IDs Over UUIDs (And You Might Want To, Too)

    If you’ve been working with distributed systems, chances are you’ve used UUIDs (Universally Unique Identifiers) at some…

    2 条评论

社区洞察

其他会员也浏览了