Managing users in Ubuntu
A short, practical guide to user management in Ubuntu and GNU/Linux
Short URL: http://fsmsh.com/1372
- 2006-08-09
- User space | Easy
-
Write a full post in response to this!
Creating and managing user groups
Although it is fine to simply leave a new user such as john in his or her own user group, you may prefer to also assign new users to another unique group. This affords not only an easier time in managing users rights, it also offers a means to share files, etc.
You do not have to assign new users to a group, the default is that they are assigned to their own personal group. But if you prefer to do so, below are the key steps.
Step 1. Start the users and groups tool
As mentioned above, access the tool from your main menu. However, instead of making changes or using the options on the “Users” tab, click on the “Groups” tab.
Scroll down until you see your new user. Notice that a group with the user’s name has also been added.
Step 2. Add a group
Now, press the Add Group button.
Notice in my example (see figure 4) that I’ve created a new group named “desktopusers”, and then highlighted my new user john. By pressing the Add button in the middle, I will add john to the group. You can add multiple users by holding down the Ctrl key and highlighting as many as you wish. Just be sure to press the Add button once you are done choosing.
Press OK when you are satisfied that all the users who belong in your new group were added (figure 5).
Notice that on your main “Users and Groups” window, the new group was added to the bottom of the list. Press OK again to save the changes.
That’s it! In the future, to change users in a particular group you can use the same steps above. But instead, highlight the group to change and press the Properties button.
What you enabled with this new group is that users, such as a working group of colleagues or friends, can now share files and manage folders that were given desktopuser group access.
Understanding the superuser
I briefly mentioned above that there are three key users in Ubuntu. This section will clarify why certain attributes exist, and what the key differences are between root and the initial user account.
Notice that in order to apply any of the steps above you needed to be logged in and use the initial Ubuntu account. The first account you create, during installation, is automatically assigned super-user do rights (also called sudo). With a super-user account, system administration and modification is possible.
The most powerful super-user account in GNU/Linux is root. However, you’ll notice that a root account is not automatically included in your Ubuntu installation details. The root does not, by default, come enabled for your use.
In situations where you must use superuser privileges, Ubuntu allows you to use the initial account combined with sudo. If for example you wanted to delete a basic user’s file folder from under Home, you would use the following commands from the command (terminal) prompt:
cd /home sudo delete john
To run the sudo command you will be prompted for your initial user password. This prevents you from having to run as root to do basic system administration, while protecting your system from security weaknesses associated with fully enabling another account as superuser.
What about root?
Ubuntu hides the root account somewhat in order to discourage its use, unless absolutely necessary. Instead, almost all of the power and privileges needed for administration are assigned to your initial account.
But what about those instances where you plan to perform some major modifications or enhancements to your Ubuntu system? I must state that this is unlikely to ever be the case for a beginning user. But, if you are in a situation similar to myself, trying to add something as major as perhaps the LTSP to your Ubuntu (edubuntu.org already has some good options for new users who want this), then you may need to apply root.
Again, before you press ahead to enable your root account, I want to convey that you should not be using root for day-to-day administration. Nor should you follow the steps below if you are brand new to Ubuntu and read some document that says “you need to be logged in as root”. Instead, use sudo as described above to run such commands.
If you’ve gotten this far, you don’t need anymore disclaimers just a simple answer. To enable root in Ubuntu you use the same steps as mentioned in section 1. However, you highlight the root user account and then press the Properties button. From there you can set the root password by hand and press OK twice to save your changes. I just urge you not to become a habitual root account user and to stick with the initial account and sudo when possible.
Troubleshooting
It’s a rare thing for me to hear about problems creating and managing users. However, there are a few things to keep in mind.
Login failure
If you created a new user account based on the steps above and get a strange error, you may have a simple problem with the user’s properties. The errors you may see include: $Home/.dmrc not properly configured, or that the HOME/user does not exist and the default directory will be temporarily set to /root.
In both cases, the error was caused by the new user’s folder not being properly configured or created. You can resolve this easily enough, by simply deleting the user and starting the steps above again. But this time, also click on the Advanced tab, when adding user, and ensure that the line for Home directory reads: /home/$user
Obviously, this only applies during initial creation of a new user account.
Changes do not save
I’ve encountered this more often than you would imagine. It seems that people sometimes get confused when pressing the OK button during the steps above. You must not only press the OK button on the specific properties Window, but also press OK once again on the main Users and Groups window in order to save your changes.
Conclusion
You should now have all the key steps needed to create and manage multiple user accounts on Ubuntu. More importantly, you should also have a reasonable understanding of what to do if you need to run a command or perform an action that requires “root access”. By applying these steps, you can share the power and pleasure of your Ubuntu system with others, while retaining security and stability.
Write a full post in response to this!
Similar articles
Do you like this post?
Vote for it!
Copyright information
Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved.
Biography
Mark Rais: Mark Rais dedicates his time and energy to promoting free software technology, especially among the poor and where a technology divide exists. He serves as senior editor for reallylinux.com. You can contact him at "markr" followed by the "at" symbol and then "reallylinux.com".
Best voted contents
-
The Jargon of Freedom: 60 Words and Phrases with Context
Terry Hancock, 2010-07-24 -
Defending the Free Commons: Another 30 Words in Context
Terry Hancock, 2010-07-14 -
MediaWiki and Script Translation for the Morevna Project
Terry Hancock, 2010-07-07 -
The Bizarre Cathedral - 75
Ryan Cartwright, 2010-07-13
Buzz authors
Free Software news
- #bookmarks #freesoftware mammoth site #gameguides http://tinyurl.com/2cy7skc
- @maheshone #Microsoft?.. Am for Richard Stallman.. #FreeSoftware
- O&O DiskRecovery 6.0.6298 x86 and x64 « Free Software Download: Free Software Download. Just another WordPress web... http://bit.ly/chosV7
- O&O DiskRecovery 6.0.6298 x86 and x64 « Free Software Download http://bit.ly/9KMUcL
- #BOOKMARKS petite article #Freesoftware #farming http://tinyurl.com/2e9co3z
Similar entries
Other sites
- The Top 10 Everything (Dave). The good, the bad and the ugly.
- Free Software news (Dave & Bridget). All about free software -- free as in freedom!
- Book Reviews: Illiterarty (Bridget). Book reviews, blogs, and short stories.
Hot topics - last 60 days
-
Storyboards for a film with Flickr, OpenClipart, Inkscape, Gimp, and ImageMagick
Terry Hancock, 2010-06-09 -
Finding Free Music for a Free Film with Jamendo, VLC, and K3B
Terry Hancock, 2010-07-13 -
Backup up your GoogleMail locally with getmail
Ryan Cartwright, 2010-06-19 -
Creating an Animatic Using Audacity and Kino
Terry Hancock, 2010-06-01 -
MediaWiki and Script Translation for the Morevna Project
Terry Hancock, 2010-07-07
Hot topics - last 21 days
-
Finding Free Music for a Free Film with Jamendo, VLC, and K3B
Terry Hancock, 2010-07-13 -
10 years on: free software wins, but you have nowhere to install it
Tony Mobily, 2010-07-29 -
The mobile banking has been entering an accelerative period
johny875, 2010-07-24 -
The Bizarre Cathedral - 75
Ryan Cartwright, 2010-07-13
Odiogo
Free Software Magazine uses Apollo, project management and CRM for its everyday activities!







Group privileges
Submitted by Anonymous visitor on Fri, 2006-08-11 16:43.
Vote!Crucial to the use of groups is allowing groups access to directories and files. I am a beginning Ubuntu user (after two years, I still think I'm a beginner!) I've set up Samba so the Ubuntu machine can act as a file server.
Please correct these instructions if I remember them incorrectly:
Pick a directory you want the group to share say group: games, directory /games_dir.
As root create the directory
mkdir /games_dir
change the ownership so the group is always games and the group will be inherited in subdirectories (-R)
chown :games -R /games_dir
change the permissions so that the owner and other members of the group can read and write. Those outside the group can do nothing. The initial "2" sets the "sticky bit" for the group permissions.
chmod 2660 -R /games_dir
WIthout these ownership and permissions settings, whenever I saved pictures from my wifes account to /pictures I'd be unable to edit them later. This way, we can both read and edit.
Corrections
Submitted by Anonymous visitor on Fri, 2006-08-11 17:32.
Vote!A very nice read indeed, especially for casual Linux users.
However, there are some small misspellings, that take away some fun of reading your article:
Ubuntu should also automatically create your new user’s folder under the /home directory.
cd /homesudo rm -rf john
(I can't remember "delete" command, really)
Don't forget about "
sudo userdel -r john" which does two things at once: it removes the user's account and their home directory in one shot.And for NOT enabling the root's account but still be able to run programs on his behalf:
sudo bash(remember, in Linux there are more ways to do the same thing)
Regards,
SirYes
shell under root
Submitted by Anonymous visitor on Fri, 2006-11-03 09:21.
Vote!>And for NOT enabling the root's account but still be able to run programs on
>his behalf:
This works also and gives you the root environment:
sudo su -
>(remember, in Linux there are more ways to do the same thing)
ciao ek
Home users/groups
Submitted by allanregistos on Sat, 2006-08-12 06:34.
Vote!I will create these groups for home users:
kid
boy
girl
adult
parent
family
A boy or a girl under the age of 18 will have the group kid as their secondary group. Same to boy or girl 18 above will have the group adult as secondary. Parents of course belongs to the parent group and will have no secondary group. All users have access to contents of the family group. In this way, I can manage contents that are unique for each home users. Just a thought..
Simultaneous Screen Users ala Windows XP?
Submitted by Anonymous visitor on Sat, 2006-08-12 07:27.
Vote!I know that Linux is a multi-user OS, however, I'm wondering if there is a way to have multiple users on a single physical screen ala Win XP.
This is a nice feature - allowing multiple users to use different logins on the same physical screen without forcing either one to log out and terminate their respective applications.
This would be very useful, for instance, when I have visitors over and I want to let them use my system, but I don't want them use my login and I don't want to terminate my running programs. They would instead use a guest account running from the same screen.
I know there's the possibility of running multiple X servers, but this seems cumbersome.
Cosmo Lee
cosmolee at bigfoot dot com
Loging in second user when another user is active
Submitted by Anonymous visitor on Sun, 2006-08-13 04:52.
Vote!Cosmo: yes, you can log in another user without logging out the previous one. To do this, choose "Switch User" from the "Quit..." menu item under the "System" menu (can also be accessed by clicking on the open door with arrow found on the right-top of the desktop).
Simultaneous screen users
Submitted by Anonymous visitor on Mon, 2006-08-21 14:30.
Vote!Furthermore, you can choose to open several sessions from one session either in fullscreen or in nested windows!
Thank you
Submitted by Anonymous visitor on Mon, 2006-08-21 22:35.
Vote!I wanted to take a moment to thank each of the readers who took time to reply on the article.
Indeed it is my hope to write more articles regarding Ubuntu and appreciate your kind replies and guidance on some of the notations above.
with kind regards,
mark rais
Administrator Deletion
Submitted by Anonymous visitor on Mon, 2006-08-28 02:06.
Vote!I was given a Hard drive with Ubuntu installed, but since I wanted to be the Administrator now that I deleted the existing admistrator but now I canon load programs without the password and I cannot restor the administrator account even to' I can log in as Adinistrater using his name and password.
System/Administration section is only half the size now.
Can anyone help please. I am loosing all respect for Ubuntu and I din't want this, I realy want to mak it work.
Rex Gladding
rexd@istnet.net.au
Unrealistic expectations
Submitted by Anonymous visitor on Mon, 2006-09-18 08:44.
Vote!Don't lose respect for Ubuntu for your mistake. If you made that type of mistake in Windows, you would experience the same problem.
You obviously are not very experienced with computers, so maybe you should take your computer to the local repair shop where they can help you out.
reinstall
Submitted by Anonymous visitor on Fri, 2006-09-29 16:23.
Vote!Do that kind of thing to any multiuser OS and it'd be broken!
Another option after killing an installation in this way is to reinstall -- go to Ubuntu.com and ask them to send you a new CD. It's probably easier that way, and you'll learn stuff :-)
same thing happened to me
Submitted by Anonymous visitor on Sun, 2007-02-25 17:38.
Vote!This would NOT have happended in windows actually. Becuase in windows you cannot delete the the administrator account. So the one reply to your post, that guy dosent know about computers.
The fix
Submitted by Anonymous visitor on Mon, 2007-04-02 20:27.
Vote!If you boot your system into single user mode:
http://wiki.clug.org.za/wiki/How_do_I_reset_my_root_password%3F
Then add a user: yourusername
then just make sure to add your user to the "admin" group, reboot and you are good to go. If you need more help, you can contact me (sharms on irc.freenode.org) and ask on #ubuntu
If you were given a disk
Submitted by Anonymous visitor (not verified) on Sat, 2007-11-24 13:40.
Vote!If you were given a disk with another install already on it, you may already have built in problems and the easiest and cleanest thing to do would be a reinstall. If you can access a system with internet access you can download an image of feisty fawn from ubuntu.org, make a cd, and boot to it. Double-click Install... you will have to give it user information, and choose a password. Write it all down! Choose to overwrite the current install, have a cup of tea, or two, and you will have a fresh, clean start.
It's very important to be patient, and persist. It took me 3 years to really learn windows, and Linux is no different. Theres a learning curve to any OS, but persistance, and patience is the key. Solving your first problem may take awhile and a lot of research and trial and error, the second will come easier, and so forth, and it really won't be long, you'll wonder why the whole world isn't using Linux.
Unless you are wealthy in the extreme, you will never be able to afford to do the things in Windows that you can in Linux for free.
Am I root?
Submitted by vgrisham on Tue, 2006-11-14 21:24.
Vote!My account is the account created on install. I can create users and am apparently a superuser. When I try to install software (firestarter) however using apt-get, I get a message that says:
E: Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
What am I doing wrong?
Thanks in advance.
sudo
Submitted by Anonymous visitor on Thu, 2007-02-15 03:31.
Vote!apt-get needs to be run as root. In ubuntu, that means the command would be:
sudo apt-get
to not have to type "sudo"
Submitted by Anonymous visitor (not verified) on Tue, 2007-05-22 05:04.
Vote!to not have to type "sudo" in front of every command, you can type "sudo -s" and you will be root, and you can type all commands normally.
Are you using sudo?
Submitted by Anonymous visitor on Sat, 2006-11-25 01:23.
Vote!Are you using sudo?
this article
Submitted by Anonymous visitor on Wed, 2006-12-06 08:04.
Vote!What is the point of this article if you use the GUI?
The comments are more useful than the article it self.
Not able to login to destop UBUNTU.
Submitted by Anonymous visitor on Mon, 2006-12-11 08:10.
Vote!I have installed a fresh copy of UBUNTU. In login screen I enter the correct user name and the password. Even then its not accepting the username and password and so i am not able to login. Could you please suugestme how exactly i can know about the login username and password.
same problem here
Submitted by Anonymous visitor on Mon, 2006-12-18 10:20.
Vote!I also installed ubuntu without any problems. It never asked for a username or password, but now I want to start and all it does is asking username and password.
Cannot log in...
Submitted by Anonymous visitor on Sun, 2007-02-04 06:49.
Vote!I renamed my administrator account and changed the default home dir. now i cannot log in as the home dir doesn't exist. I have created a new user but only with limited rights. is therte a way i can restore my orginal login?
I did this as well and had
Submitted by BobT_KY (not verified) on Tue, 2007-06-26 16:03.
Vote!I did this as well and had to startup a failsafe terminal session (use F10 when logging in to get safe mode menu options). I then used "su" to switch to root. Created /home/new__username and used "chown" new_username /home/new_username. I then had to hard shut down the PC (could not figure out how to exit the root temrinal session, tried "exit" "quit," ctrl-z, ctrl-c etc.) and logged in as new_username and all was ok.
mouse not dectated
Submitted by Anonymous visitor on Wed, 2007-02-07 07:09.
Vote!in my ubuntu mouse is not deteacting so help me to activate my mouse
1. check to see if it's
Submitted by Anonymous visitor (not verified) on Tue, 2007-05-22 05:06.
Vote!1. check to see if it's plugged in.
2. check to see if it works on a nother computer.
3. try rebooting
4. come back here.
about settings on the internet
Submitted by Anonymous visitor (not verified) on Wed, 2007-07-11 13:06.
Vote!i installled ubuntu, i did this thing with the admin settings. but i cant get acces in the internet settings. it beheaviour like i dont done the step before. i cant type my ip adres, my username and anything else. what to do?
I assume "john" is Mark's
Submitted by Anonymous visitor (not verified) on Thu, 2007-07-12 23:15.
Vote!I assume "john" is Mark's 'partner'.
John?
Submitted by MRais (not verified) on Wed, 2007-07-18 01:23.
Vote!Hmmm.
Actually, I have been writing so many user guides that I ended up just using "John Smith" and/or "John" as simple example users.
Note that I use "John Smith" more like "John Doe" than someone specific like "Captain John Smith". ;)
sudo permissions
Submitted by newlyweds on Wed, 2008-01-30 18:28.
Vote!I have some folders i cant get into with my initial user priviledges. I am very new to using another type of operating system such as linux but with ubuntu it is a fairly easy transition thus far. My friend is a tech nerd and is the one who installed it for me but he is deployed and i want to try to resolver this my self.
here is the issue.
I have two folders that are designer within my hardware for mass storage but I do not have read, write, or execute permissions to them is there a way that I can essentually give myself aka my account the neccessary permissions to them. my friend believe they fall into the root permissions or something like that.
Any help would be amazing!!! when replying please refer to my username. LOL thanks
How to manage users and groups from terminal window?
Submitted by jpmd on Sat, 2008-06-14 21:32.
Vote!This tutorial is excellent: clear and easy to follow.
I'm curious, however, how to do all this from a terminal window. I built a LAMP server with Ubuntu 8.04 and I want to avoid installing the GUI if I can.
I'm using PuTTY to access the Ubuntu box remotely, hoping to make it a headless web server.
I'm pretty new to the whole Linux thing, as you can tell.
Thanks for your help!
John