About Users and Groups

Hello everybody,

I just got a Linode a couple weeks ago, and I am enjoying it, learning a lot of new stuff. I am pretty new to the whole server administration thingy even though I am (relatively) confortable with the Unix command line since I have used Ubuntu for a couple years and OS X for the past two years.

Anyway, here is my question: I am the only user using my linode, and I will (probably) always be. I don't want to keep using the root account, I want to create a new user for myself and add him to the sudoes. But I can google it to help me do that. What I am confused about is the following:

  • In which group should I put that group? I think I should probably add him to the admin group but should I also create a new group and put him in it too? How about the staff group? On my mac all my files/folders are assigned to the staff group by default…

  • I just tried to install DokuWiki. When I untared the archive, the new dir was assigned to the crontab group automatically (a bit odd if you ask me). So to what group should I assign Web apps/folders/files that I create?

6 Replies

When you add a linux user it gets it's own group so say the user is called "bob" it will be in the group "bob" no need to add it to another group.

To add it to sudo use the visudo command and add

bob    ALL=(ALL) ALL

Under the bit where it says root.

As for dokuwiki you're opening a whole can-o-worms on what permissions and groups you should assign web stuff.

Personally I make a user for each of my sites and store the files in /home//public_html, the files are then owned and grouped by to , with 0644 permissions on files and 0755 on directories (owner writable, everything else readable).

Some people prefer to store them in the /var/www folder, what you don't want to do is allow the files to be writable by the web server, so don't chown www-data or whatever your webserver runs as.

I think I am going to do something similar to what you are doing.

All my webapps are stored in /srv/www/{example.com}/publichtml/{hypotheticalsubdomainnotcounting_www}. What I will do is create a new user and assign the webapps to his group with the appropriate permissions (755 and 644).

Thanks a lot for your answer.

A (perhaps) simpler approach is to use the admin group that Ubuntu* already has set up. You can add a user bob to the admin group with the command

usermod -a -G admin bob

and you're all set.

At least, Ubuntu 8.04 does, not sure about later versions. If the line %admin ALL=(ALL) ALL* is in your /etc/sudoers then this applies to you too.

That line isn't in later versions, or not at least on linode, I checked.

I confirm that the admin group is not in Ubuntu 9.10+ (9.10 being what I use). But I did create the admin group and added it to the sudoers like you specified (I actually found that trick on a blog post).

Anyway, thanks for the help ;)

That loud thumping sound is my head hitting the table repeatedly.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct