The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > SUN Solaris
.
google unix.com



SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems .

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
HP-UX usermod remove secondary groups Ikon Shell Programming and Scripting 2 03-10-2009 06:17 PM
Usermod returning syntax error syndex Shell Programming and Scripting 6 07-02-2007 12:38 PM
Help required for usermod command gun UNIX for Dummies Questions & Answers 1 11-28-2006 05:45 AM
help interpreting usermod man page amheck SUN Solaris 0 06-08-2006 03:29 PM
usermod -e amheck UNIX for Dummies Questions & Answers 1 05-23-2006 07:02 PM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-13-2009
Tex-Twil Tex-Twil is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 46
usermod vs rolemod

Hello,
I'm a bit confused by the usage of those two commands. I have 2 freshly installed systems and the behaviour is different from one system to another.

Code:
root@systemONE rolemod -G mygroup postgres
UX: rolemod: ERROR: Users most be modified with ``usermod''.


root@systemTWO usermod -G mygroup postgres
UX: usermod: ERROR: Roles most be modified with ``rolemod''.
So how can I know which command do I have to use to add a user to a group ?

Thanks,
Tex

Last edited by Tex-Twil; 07-13-2009 at 11:09 AM..
  #2 (permalink)  
Old 07-13-2009
kumarmani kumarmani is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 343
What it look like that in one box postgres is a role and in other system it a group name. The best option is to check the /etc/group and see if the it postgres. Also, in case if myuser is a user and if you are trying to add user to the group postgres then the command usermod syntax is wrong.

If you know nay user is part of a given role then use the command roles <username> to fine the roles assign to an individuals
  #3 (permalink)  
Old 07-13-2009
Tex-Twil Tex-Twil is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 46
Quote:
Originally Posted by kumarmani View Post
What it look like that in one box postgres is a role and in other system it a group name. The best option is to check the /etc/group and see if the it postgres.
In both system is a group postgres.

Quote:
Originally Posted by kumarmani View Post
Also, in case if myuser is a user and if you are trying to add user to the group postgres then the command usermod syntax is wrong.
I wasn't clear here. I want to add the user postgres to the group "mygroup". (I edited the commands above)

Tex
  #4 (permalink)  
Old 07-13-2009
kumarmani kumarmani is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 343
On the system where you are getting error message as “UX: usermod: ERROR: Roles most be modified with ``rolemod''. Please check the file /etc/security/prof_attr and /etc/security/auth_attr and see if you can get any line related to postgres
  #5 (permalink)  
Old 07-14-2009
Tex-Twil Tex-Twil is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 46
Quote:
Originally Posted by kumarmani View Post
On the system where you are getting error message as “UX: usermod: ERROR: Roles most be modified with ``rolemod''. Please check the file /etc/security/prof_attr and /etc/security/auth_attr and see if you can get any line related to postgres
Quote:
~$ cat /etc/security/prof_attr | grep post
Postgres Administration::::auths=solaris.smf.manage.postgres,solaris.smf.value.postgres
I think I get it now. On one system there was (SUN) postgres installed by default and I guess that this package creates a role postgres hence the error message:
Code:
~$ usermod -G mygroup postgres
UX: usermod: ERROR: Roles most be modified with ``rolemod''.
So can I rely on those file to decide which of the two commands I have to use the add the user to a group ?

Thanks,
Tex

---------- Post updated 07-14-09 at 04:22 AM ---------- Previous update was 07-13-09 at 10:51 AM ----------

I think I found the command I needed:

Code:
# auths postgres
solaris.smf.manage.postgres,solaris.smf.value.postgres,solaris.device.cdrw,solaris.profmgr.read,solaris.jobs.users,solaris.mail.mailq
So if this output contains "postgres" I should use rolemod to add the user postgres to a group, otherwise usermod.

Is that correct ?
  #6 (permalink)  
Old 07-14-2009
kumarmani kumarmani is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 343
Yes, I mean you can decide with the help of above that you need usermod or rolemode to modify the postgres !!!
  #7 (permalink)  
Old 07-14-2009
Tex-Twil Tex-Twil is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 46
EDIT3

No the auth command doesn't help. I think I have to grep the /etc/user_attr file to know if there is a role postgres.
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:53 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0