LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 01-17-2013, 10:06 AM   #1
Curiosity42
LQ Newbie
 
Registered: Jan 2013
Location: Earth
Posts: 20

Rep: Reputation: 0
RHEL 6.1 user creatation/configuration at login time with limited KDE Start Menu


I have installed RHEL 6.1 with KDE 4.3.4 using LDAP and have now the following problem.
I would like to create a user account at first login time and configure a limited KDE Start Menu at the same time.
I was reading already the stuff about the files in the directory /etc/skel getting copied across at first login time, but I need to copy a tailored KDE Start Menu (very limited functionality) to the user directory .local/share/applications/at first login time using LDAP.
Does someone has a solution for this problem?
 
Old 01-18-2013, 02:48 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well the very point of /etc/skel is to tailor it to your needs. just put that file structure in there too.
 
1 members found this post helpful.
Old 01-18-2013, 03:07 AM   #3
Curiosity42
LQ Newbie
 
Registered: Jan 2013
Location: Earth
Posts: 20

Original Poster
Rep: Reputation: 0
Does that mean that the directory structure below /etc/skel like:

/etc/skel/.local/share/applications/<file1> would be copied to /home/<user1>/.local/share/applications/<file1> and as conclusion that the whole directory tree below /etc/skel/ would be copied to the /home/<user1>/ directory?
 
Old 01-18-2013, 03:15 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
yes, it's a basic "skeleton" of what a users directory should look like.
 
1 members found this post helpful.
Old 01-18-2013, 03:31 AM   #5
Curiosity42
LQ Newbie
 
Registered: Jan 2013
Location: Earth
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks, I much appreciate your answer.
I still have a question? If I have users/profiles that I would like to populate with a slightly different 'skeleton', would that be possible with that mechanism,too ?
 
Old 01-18-2013, 03:52 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
I'm not sure but it would more than likely depend on how you are differentiating them. What logic is used to define which user is which type?

there appear to be pam modules like pam_exec to run arbitrary code before creating the homedir, but what occurs to me as a simpler scenario is to actually keep a common skel setup but add a check in bashrc to *always* run a script IF it exists. This 2nd script could then obviously customize whatever you want, possibly copying a /etc/skel_2 or something to the new users directory as well. you can then delete the script after executing it, meaning it'll never update those files again.

Last edited by acid_kewpie; 01-18-2013 at 03:56 AM.
 
1 members found this post helpful.
Old 01-18-2013, 05:32 AM   #7
Curiosity42
LQ Newbie
 
Registered: Jan 2013
Location: Earth
Posts: 20

Original Poster
Rep: Reputation: 0
I am planning to define four groups of users and each group of users will have a certain (limited) KDE Start Menu and certain (limited) permissions. All these attributes shall be copied/set at first login time.

I am going to try the two possibilities, suggested from you, next week and report the results in this thread.

Thanks for your help.
 
Old 01-18-2013, 07:05 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
ok, so you can probably have something pretty simple in the .profile:

Code:
if [[ ! -e ~/flag_file_you_copy_from_the_dir_below ]]
then
   if [[ -d /etc/skel_$(group) ]]
   then
      cp -r /etc/skel_$(group)/* ~
   fi
fi
that by itself will clone the group specific directory. Not tested mind...
 
1 members found this post helpful.
  


Reply



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
[SOLVED] shell script to give root access to user for limited time? rakrr786 Linux - Newbie 9 05-31-2012 12:08 AM
How to add e menu entry to KDE start menu over CLI browny_amiga Linux - General 7 02-08-2009 03:05 PM
KDE screensaver lock time limited to 300 seconds utahnix Linux - Software 1 07-13-2007 11:22 PM
Mozilla Firefox - limited user time ursinus Linux - Software 2 08-03-2006 11:05 AM
KDE 3.1 wont start at login, but only for one user nudeatom Mandriva 1 01-07-2004 04:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 02:09 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration