How to Create a Role and Assign the Role to a User
Example 2-1 Creating a Role and Assigning the Role to a User
This example shows how to create the ldm_read
role, assign the role to the user_1
user, become the user_1
user, and assume the ldm_read
role.
# roleadd -P "LDoms Review" ldm_read # passwd ldm_read New Password: Re-enter new Password: passwd: password successfully changed for ldm_read # useradd -R ldm_read user_1 # passwd user_1 New Password: Re-enter new Password: passwd: password successfully changed for user_1 # su user_1 Password: $ id uid=95555(user_1) gid=10(staff) $ roles ldm_read $ su ldm_read Password: $ id uid=99667(ldm_read) gid=14(sysadmin)