Create user with rules


 
Thread Tools Search this Thread
Operating Systems Solaris Create user with rules
# 1  
Old 05-02-2007
Lightbulb Create user with rules

Hi all,

i'm have some prob in solaris os system, i need to create users which have own home directory,can log user activity,set user group.

can anybody help?

Please advice

Thank you

bucci
# 2  
Old 05-02-2007
Code:
useradd -g group -c ‘User Name’ -d /path/to/home/directory -s /path/to/shell username

"man script" to log terminal sessions.
# 3  
Old 05-02-2007
Quote:
Originally Posted by bucci
Hi all,

i'm have some prob in solaris os system, i need to create users which have own home directory,can log user activity,set user group.

can anybody help?

Please advice

Thank you

bucci
You may need to use expect to interact with the passwd command to set the users initial passwd or minipulate the std in and std out since the passwd command requires user input.
# 4  
Old 05-03-2007
Hi,

Thanks for the response, btw how to set limitation for each users access :

example : john = just only can read files
smith = can read and write

where is the logs for each users activity which created it?

please advice

Thank you


Best Regards,

bucci
# 5  
Old 05-03-2007
Here is a good explanation for permissions and groups, as for the logs : depending on the shell you've chosen they may be located at "/home/folderr/of/user/.bash_history"
# 6  
Old 05-05-2007
Hi sysgate,

Thanks for your help

how if i want to log for all users activity into the file generate each day and only root can open the file ?

Please advices

Thank you

Best Regards,

bucci

Quote:
Originally Posted by sysgate
Here is a good explanation for permissions and groups, as for the logs : depending on the shell you've chosen they may be located at "/home/folderr/of/user/.bash_history"
# 7  
Old 05-07-2007
If you want to achieve this, the logic should be as follows :
echo Logs for user John; cat /home/john/bash_history > /root/userslog.file && chmod 700 /root/userslog.file # this will make it available only for root.
echo Logs for user Mike; cat /home/mike/bash_history >> /root/userslog.file # This will append Mike's logs, and leave a comment whose logs are these.
The same for other users. When this is done, just do : mailx -s "Users' logs" your@adminmail.tld < /root/userslog.file
Something like that, this is what I can think of on the fly, certainly, there are more elegant solutions (I have something in mind).
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find if a User exist if not create user

What I'm trying to do is write a script in Perl to find a user and if that user exist it would print "User Exist, Pls Try Again". If The user doesn't exist I'm able to create a user with a password. Any suggestions? (3 Replies)
Discussion started by: GoBoyGo
3 Replies

2. Homework & Coursework Questions

Create script to add user and create directory

first off let me introduce myself. My name is Eric and I am new to linux, I am taking an advanced linux administration class and we are tasked with creating a script to add new users that anyone can run, has to check for the existence of a directory. if the directory does not exist then it has... (12 Replies)
Discussion started by: pbhound
12 Replies

3. Ubuntu

Create New User with the same group nd privileges of the other user

Hi, Anyone can help me on how to duplicate privileges and group for useroradb01 to userrootdb01. I have currently using "useroradb01" and create a newly user "userrootdb01". I want both in the sames privileges and group. Please see the existing users list below; drwxr-xr-x 53 useroradb01... (0 Replies)
Discussion started by: fspalero
0 Replies

4. Solaris

how to create an user

hi can anyone help me out to create an user to access specific folder only. (5 Replies)
Discussion started by: aemunathan
5 Replies

5. HP-UX

How to create a user in HP-UX

HI Guys, Can you help me creating a user account in a HP-UX server (3 Replies)
Discussion started by: Harikrishna
3 Replies

6. HP-UX

create user

I need to create new user from the root.which command can i used ? (2 Replies)
Discussion started by: magasem
2 Replies

7. UNIX for Dummies Questions & Answers

I create user but i cant login the user i created.

I created a user, i login as a root. I add him in the group where he can access and login as a root! I checked it in users' list and in group's list, he is there. My problem is this, I cant login using the username/account I just created! What should i do to use and login the user/account i've just... (5 Replies)
Discussion started by: jerome
5 Replies

8. UNIX for Advanced & Expert Users

Other than root user .Normal user is unable to create files

Hi all, I am using Sun Solaris 9 .In this system normal users unable to create files from the command line.I added these users in bin,adm and even root group i found them unable to create a file. (1 Reply)
Discussion started by: mallesh
1 Replies

9. UNIX Desktop Questions & Answers

Need to create a user...

who you can't log in as, but you can su over to them once you get on. I am aware of how to make a no login user by using /NOSHELL in the spot for the shell in the passwd file, but my question is if I do that and then get on the box as a user who I can log in as and "su -" over to the nologin... (5 Replies)
Discussion started by: New_Guru
5 Replies
Login or Register to Ask a Question