1830045 Members
4609 Online
109998 Solutions
New Discussion

SAM user and my user

 
Purusa
Frequent Advisor

SAM user and my user

Hi,

I had one small doubt. How can I find out what are the different settings associated with a SAM defined user and a user created by me with the help of a script? Through my script I make entries of the user in /etc/group file and /etc/passwd file. Based on entries in these files I give different permission to different users.

Please let me know if anyone has any info.

Regards,
Pankaj
A deep chasm can't be crossed in two steps
8 REPLIES 8
Robert-Jan Goossens
Honored Contributor

Re: SAM user and my user

Hi Pankaj,

Is your own script based on the useradd command.

Check the man page for this command.

Hope this helps,
Robert-Jan
Victor Fridyev
Honored Contributor

Re: SAM user and my user

Hi,

As far as I know, SAM creates users as follows:
1. Basics: It checks all possible duplications, creates the user by useradd, using the parameters, which you defined and run ypmake, if there is NIS-master on the computer.
2. Some addins:
One can use user's templates, previously created.
There is very good feature, which permits to run a script after adding or deleting of a user.
Actually you can do this in your script, the decision is yours.
Entities are not to be multiplied beyond necessity - RTFM
Purusa
Frequent Advisor

Re: SAM user and my user

Yes my script is using 'useradd' command to add a user. Since SAM is also using the same command(as told by Victor), can I conclude there will be no difference between the properties of two users?
A deep chasm can't be crossed in two steps
RAC_1
Honored Contributor

Re: SAM user and my user

For getting into details, add a user through SAM and check /var/asam/log/samlog file. You will get what is the exact command that SAM uses.

Also you may want to have a look at useradd -D output. These are the default values used when adding a user. You cal also put these values in /etc/default/useradd file.

Anil
There is no substitute to HARDWORK
Purusa
Frequent Advisor

Re: SAM user and my user

Hi all,

I just lost tract of this.
Continuing with the same.......

My script uses the following commands to create a user:

useradd -u and
/usr/sam/lbin/usermod.sam

whereas SAM uses upusrfiles -r to create the user.

So can there be any difference in the shell variables/ unix related parameters which can be different in both the cases?
A deep chasm can't be crossed in two steps
Tom Maloy
Respected Contributor

Re: SAM user and my user

Try
/usr/lbin/getprpw user1
and
/usr/lbin/getprpw user2

and look for differences. I would not expect that you will find any.

Tom
Carpe diem!
Purusa
Frequent Advisor

Re: SAM user and my user

Hi,

getprpw command is not working as it says," System is not trusted". Any other method of comparison????

Thanx and Regards,
Pankaj
A deep chasm can't be crossed in two steps
Jose Mosquera
Honored Contributor

Re: SAM user and my user

Hi,

I am not sure of the purpose that you look for when establishing differences, but this perhaps can help you.

Any activity about the utility SAM is registered in / var/sam/log/samlog, in the manual way is not it. For this, when sam add teh user "pankaj", this log must reflect something like:
samlog:Adding user pankaj.
samlog:Executing the following command:\C/usr/sam/lbin/upusrfiles -r pankaj\C
samlog:upusrfiles: Creating home directory "/home/pankaj".
samlog: /etc/skel/.cshrc /home/pankaj/.cshrc 2>/dev/null\C
samlog: /etc/skel/.exrc /home/pankaj/.exrc 2>/dev/null\C
samlog: /etc/skel/.login /home/pankaj/.login 2>/dev/null\C
samlog: /etc/skel/.profile /home/pankaj/.profile 2>/dev/null\C
samlog:Successfully added user pankaj.

If you want, for any reason, set a specific difference at the moment to create an user by use of the command "useradd", you would do:
To create a customized log that registers this event,
To add a comment, option -c of the command "usseradd." i.e:
#useradd -u 999 -g your_group -d /home/pankaj -m -s /usr/bin/sh -c your_comment pankaj

I hope that be usefull for you.

Rgds.