Operating System - HP-UX
1833779 Members
1811 Online
110063 Solutions
New Discussion

Individual accounts and individual directory and file permissions

 
SOLVED
Go to solution
Allan Tagliaferro
Occasional Contributor

Individual accounts and individual directory and file permissions


Hi all,

Can any unix guru help me out, I'm trying to setup individual unix accounts with individual directory and file permissions for users.

How is this done?

Please Help
Thank you !!
5 REPLIES 5
Scott Van Kalken
Esteemed Contributor

Re: Individual accounts and individual directory and file permissions

by default on hpux user home directories are 700 - that is, only that user can read them.

If you want more - you can go even further and go for BSD style account setup.

That is - have each user with their own group. For example:

user scott
pri grp scott

This would have scott:scott ownerships on files etc...

This makes managing accounts (if there are hapes of them) quite difficult.

It's just a thought.

Scott.
Roger Baptiste
Honored Contributor

Re: Individual accounts and individual directory and file permissions

hi,


Two methods:

use SAM where it prompts you for each entry (directory etc..)

or use the command useradd

useradd -u 911 -g helpdesk -d /home/helpdesk -s /usr/bin/ksh -c "HELPDESK" -m helpdesk

-> this will create the account helpdesk with the homedirectory as /home/helpdesk...

You can run the command in a loop picking up info from a info file containing the user details. That way, you can create multiple accounts with different usernames , properties etc.
(use the while read loop)

If you want to customize further , setup up a customized .profile file and copy it on to the user''s home directories after creating the accounts.

HTH
raj
Take it easy.
harry d brown jr
Honored Contributor

Re: Individual accounts and individual directory and file permissions

When setting up user accounts the first thing to do is to create "logical groups" (groups of users that have similar properties).

To do this, go into 'sam', select user accounts, then add groups.

Then to add users, goto add users. For starters use the defaults.


live free or die
harry
Live Free or Die
Bill Hassell
Honored Contributor
Solution

Re: Individual accounts and individual directory and file permissions

1. The simplest by far, is to use SAM since it performs all the details for you. Permissions and preset $HOME files are setup automatically.

2. The second choice is to use the tool created by SAM: useradd The man page will give you all the details.

3. The 3rd (painful and labor intensive) is manual:

a. Use vipw to edit the password file (ONLY on non-Trusted Systems). If you have a Trusted System, choose item 1. Pick and unused user ID number (typically greater than 100), find the group ID you want to use, then construct the password entry. Read the man page for passwd (NOTE: man 4 passwd). Use existing passwd entries as a template. Leave the password blank for now. Once the passwd entry is complete, save the new entry (be very careful, especially if you don't use vi very much...corrupting the password file can prevent users, even root, from logging in).

b. Make the user's $HOME directory, copy the statrup files and then change the permissions:

# mkdir /home/new_user
# cp -r /etc/skel cp -r /etc/skel/* /etc/skel/.??*
# chown new_user:group_ID /home/new_user
# chmod 755 /home/new_user

Then immediately login as the new user (no password will be necessary), and change the password to a reasonable string.

Now you have a new user. Repeat as necessary (or refer to item #1 again).


Bill Hassell, sysadmin
Michael Tully
Honored Contributor

Re: Individual accounts and individual directory and file permissions

Hi,

Why not setup a user template through
SAM. It is probably the easiest way
for you.

sam --> Accounts for Users and Groups
users -->
Actions --> User Templates --> Create
and fill in the necessary information.
I think that will give you an idea of
exactly what you want. Each site is
different and there are many applications
that require many different combinations
of user setup requirements.

HTH
-Michael
Anyone for a Mutiny ?