Life in code, apps and OS's

How to add and remove user’s in Ubuntu.

Posted on: January 14, 2007

How to add a user in Ubuntu (and how to create a home directory)

useradd -m ballen
passwd ballen
(Set password)

All should then work fine.

How to delete a user’s account (and how to also delete the home directory too)

userdel ballen – Just removes the users account
userdel -r ballen – Removes the account and the users home directory.

How to view all user accounts:

Users – cat /etc/passwd | cut -d: -f1
Groups – cat /etc/group | cut -d: -f1

How to create auto-home directory folders:

Some times you may want to deploy automatic folders to user’s home directory’s when the account is created for example ‘public_html’ is a directory that when Apache is running can be configured for personal website hosting and the users personal website can be viewed at: (depending on the apache configuration) therefore you may want to create this public_html folder to automatically add to the user’s home dir, To do this we have to create a folder in the /etc/skel directory (stands for Skeleton) and give it the correct permissions, This can be done using the following commands:-

cd /etc/skel
mkdir public_html
chmod 777 public_html/

Now a folder named public_html has been created in /etc/skel and the correct permissions have been added so that web users can view and read any data on the user’s site. All you need to do now (if it isn’t already) is to configure Apache to serve User home directorys.

2 Responses to "How to add and remove user’s in Ubuntu."

[…] sumber Like this:SukaBe the first to like this post. « Tulisan Sebelumnya […]

Um “users” not “user’s”…

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


  • How To Dyndns Ubuntu | Order Goods: […] DynDNS Client Setup on Ubuntu | Life in code, apps and OS’s – May 18, 2008  · 7 Responses to "DynDNS Client Setu
  • lizrandolph10886: Wonderful article! We are linking to this particularly great post on our website.nKeep up the great writing. Click
  • waseem Ahmad: Dear. i have a separate application server and a separate mysql database server. when i want to access the application server to login from the local
%d bloggers like this: