Hints and Tips Topic
   >  Changing the Hostname
   >  Finding your IP & Mac Address
   >  Creating Users and Groups
   >  Running Scripts at Startup
   >  Network Interface Configuration
   >  Changing the Grub Default Option

 

Adding Users and Groups on Linux

Creating New Linux Groups

Sometimes, it's necessary to grant a group of users the same set of privileges on your machine - for example, if you have remote users accessing your data and you want to limit what they can and cannot do. This is where Linux groups come in handy. You can create any number of groups and assign any user(s) to them in Linux: you can even assign a user to multiple groups, but you need to be sure of the security implications before you try this! Once the group is set up, you can assign can assign any number of files to the group, as opposed to the individual users.

[Groups allow you] to grant a group of users the same set of privileges on your machine

You can add new groups from the command line using the syntax:

sudo groupadd -g <Group ID> <groupname>

For example, the following will create mygrp with a group ID of 123:

sudo groupadd -g mygrp

Note: the groupadd command has other options : type man groupadd for details

In Ubuntu, you can also create groups direct from the GUI using:

System → Administration → Users and Groups

..and clicking on the "Manage Groups" button:


Creating New Linux Users

Occasionally, you may need to create new users on your PC - either to allow them to logon directly or to be able to access services on it remotely. You can add new users from the command line using the syntax:

sudo useradd -g <Group ID> -m -c <comment of what the account is for> <username>

For example, the following will create a guest account - and /home/guest - under group 123:

sudo useradd -g 123 -m -c "User for guest access" guest

Note: the useradd command has many more options : type man useradd for details

In Ubuntu, you can also create users direct from the GUI using:

System → Administration → Users and Groups


HomeSite IndexDesktop GuideServer GuideHints and TipsHardware CornerVideo SectionContact Us

 sitelock verified Firefox Download Button