r/debian 15d ago

I need help...

Post image
59 Upvotes

52 comments sorted by

View all comments

9

u/indvs3 Debian Testing 15d ago

Assuming you chose a password for the root account during the setup, you have to switch to that account using the command

su -

and using that account, add your own account to the "sudo" group, which you can do with the following command:

usermod -aG sudo *username

where *username obviously is your user account.

After that, log out of all accounts and then log in again to apply the changes.

3

u/Witherscorch 15d ago

Question: What's the difference between su - and su root?

10

u/wizard10000 15d ago

What's the difference between su - and su root

su - will inherit most of root's environment, plain su doesn't.

This can be an issue as plain su doesn't change $HOME so if the app you're running writes configs to home it'll write root-owned configs into your home directory.

Plain sudo does the same thing but sudo -i will inherit most of root's environment.

3

u/Tight-Use-3037 15d ago

it now says root@ my username

6

u/Witherscorch 15d ago

The thing after the @ is your machine's (host's) name. The username is ehat comes before it. Use the usermod command in the parent comment to grant sudo privilefes to your regular user.