Operating System - HP-UX
1826269 Members
3595 Online
109692 Solutions
New Discussion

Re: default perms on .* startup files when creating a new user

 
SOLVED
Go to solution
Vanja
Frequent Advisor

default perms on .* startup files when creating a new user

Hello all - this question pertains HPUX 11.0

Is there a way to set a default permission on .profile, .login and other startup files in a user's home directory when creating a new user with sam. The permissions on these files don't seem to correspond to /etc/skel permissions for these files when I create a new user.

Example: setting on .profile in /etc/skell is 440 and when I create a new user using sam the permissions in home directory for user are 644 for .profile.

Thanks in advance!
Vanja
4 REPLIES 4
Steven E. Protter
Exalted Contributor
Solution

Re: default perms on .* startup files when creating a new user

You set the permissions on the files in /etc/skel

That sets the default permissions on the files when a user is created using /etc/skel. Since thats not doing it, set the umask in the script that creates the user. That should do the job.

As a practical matter, our user add script sets the permissions and then displays them so that the oeprator knows what was done.

The .profile and other files merely need to be readable by the user. They don't need execute permissions because they are not executed. They don't need to be owned by the user either.

For many of my users I don't let them edit their profiles, because they do things that create security problems.

SEP

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Pete Randall
Outstanding Contributor

Re: default perms on .* startup files when creating a new user

Vanja,

You can add a script to run after SAM finishes adding the user. Go into SAM > Users and Groups > Users, then select Actions > Task Customization and enter the full path name of the script you want to have executed. The Help section will explain how you can pass parameters to the script and such.


Pete

Pete
Fabio Ettore
Honored Contributor

Re: default perms on .* startup files when creating a new user

Hi Vanja,

most useful info was provided by Steven and Peter.
Anyway if you would like to create an user (and of course his/her home directory) bypassing SAM:

# useradd -mk /etc/skel

This command will create a user's home directory with same permissions of /etc/skel/.profile and other files under it.

Just a thought...

Best regards,
Ettore
WISH? IMPROVEMENT!
Vanja
Frequent Advisor

Re: default perms on .* startup files when creating a new user

Thanks All for the quick responses - that clarifies it for me now.

Vanja