Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-29-2008, 03:39 AM   #1
LQ Newbie
Registered: May 2007
Posts: 6

Rep: Reputation: 0
useradd home folder structure

Is there any way to provide a script execution after useradd command or a way to create a home skeleton for new users?
What i want to achieve is to create some specific folders (owned by the new user) in new users home folder.

thanks in advance.
Old 01-29-2008, 06:18 AM   #2
Junior Hacker
Senior Member
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
There should be no problem creating a folder tree (structure) with a bash script. It's also a good idea to study scripting a little and come up with the exact script that does exactly what you want. Use "Beginners bash scripting" as keywords in a Google search to find many beginners guides.
You can also make a directory tree with a simple command called "mkdir", by typing "man mkdir" in a console you can read the manual pages. An example follows that creates folder inside of new folders made in the same command:
#mkdir /home/jo/shell /home/jo/shell/shock /home/jo/shell/shocked /home/jo/shell/shock/ray
Old 01-29-2008, 07:11 AM   #3
LQ Newbie
Registered: May 2007
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks for answering, i got your point but i want to avoid the execution by hand of the bash script which creates the home skeleton after each useradd execution. Just looking for an automated way to execute a bash script after command useradd gets executed.


useradd, users

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Home folder icon does not open home folder CiscoGeek Linux - Newbie 3 12-18-2006 08:00 AM
I can not open the user folder in home and write in a shared folder jorge_ivan Linux - General 8 08-02-2006 12:28 PM
Folder Max Size and Limiting SSH access to home folder. Mefistofeles Linux - General 4 11-26-2005 03:09 PM
rearrange folder structure using mp3 tags roemisch Linux - Software 1 04-18-2005 11:15 AM
ahred folder structure d_kilshtein Linux - Networking 2 10-31-2004 07:11 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:51 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration