LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   RHEL 6.1 user creatation/configuration at login time with limited KDE Start Menu (https://www.linuxquestions.org/questions/red-hat-31/rhel-6-1-user-creatation-configuration-at-login-time-with-limited-kde-start-menu-4175446038/)

Curiosity42 01-17-2013 10:06 AM

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?

acid_kewpie 01-18-2013 02:48 AM

well the very point of /etc/skel is to tailor it to your needs. just put that file structure in there too.

Curiosity42 01-18-2013 03:07 AM

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?

acid_kewpie 01-18-2013 03:15 AM

yes, it's a basic "skeleton" of what a users directory should look like.

Curiosity42 01-18-2013 03:31 AM

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 ?

acid_kewpie 01-18-2013 03:52 AM

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.

Curiosity42 01-18-2013 05:32 AM

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. :)

acid_kewpie 01-18-2013 07:05 AM

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...


All times are GMT -5. The time now is 10:32 AM.