Managing Users and Groups

Managing Users and Groups on Linux

Proper user management is essential for server security. Avoid running everything as root.

Create a New User

adduser username

Grant Sudo (Admin) Privileges

usermod -aG sudo username    # Ubuntu/Debian
usermod -aG wheel username   # CentOS/RHEL

Switch to a User

su - username

Delete a User (and Their Home Directory)

deluser --remove-home username    # Debian/Ubuntu
userdel -r username               # CentOS/RHEL

List All Users

cat /etc/passwd

Create and Manage Groups

groupadd mygroup
usermod -aG mygroup username
groups username
  • 0 brukere syntes dette svaret var til hjelp
Var dette svaret til hjelp?

Relaterte artikler

Managing Services with systemctl

Managing Services with systemctl systemctl is the standard tool for managing services on modern...

Monitoring Server Resources

Monitoring Server Resources Keeping an eye on your server's resource usage helps you identify...

Scheduling Tasks with Cron

Scheduling Tasks with Cron Cron allows you to schedule commands to run automatically at set...

Installing and Configuring Nginx

Installing and Configuring Nginx Nginx is a high-performance web server and reverse proxy widely...

Installing and Configuring Apache

Installing and Configuring Apache Apache is the world's most widely deployed web server, known...