LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 01-29-2008, 02:39 AM   #1
def_bond
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, 05:18 AM   #2
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
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:
Quote:
#mkdir /home/jo/shell /home/jo/shell/shock /home/jo/shell/shocked /home/jo/shell/shock/ray
 
Old 01-29-2008, 06:11 AM   #3
def_bond
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.
 
  


Reply

Tags
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 07: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 11:28 AM
Folder Max Size and Limiting SSH access to home folder. Mefistofeles Linux - General 4 11-26-2005 02:09 PM
rearrange folder structure using mp3 tags roemisch Linux - Software 1 04-18-2005 10:15 AM
ahred folder structure d_kilshtein Linux - Networking 2 10-31-2004 06:11 AM


All times are GMT -5. The time now is 07:39 PM.

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