Linux User Management and file permissions / ownerships related commands

To add a new group called Oracle use:
[root@badar /]# groupadd Oracle


To add new user Shaheer and make him a member of the group Oracle, use:
[root@badar /]# useradd -s /bin/false -g Oracle Shaheer


To change the password if some user, say Shaheer, run the following command as root:
[root@badar /]# passwd Shaheer


To lock the password of user Shaheer, run the following command as root:
[root@badar /]# passwd -l Shaheer


To un-lock the password of user Shaheer, run the following command as root:
[root@badar /]# passwd -u Shaheer


To delete a user say Shaheer, including his home directory, use:
[root@badar /]# userdel -r Shaheer


To change  permissions of an object (file or directory), use chmod:
[root@badar /]# chmod 770 myfile.txt 
or
[root@badar /]# chmod ug+rwx,o-rwx myfile.txt


To change ownership of a directory /project to Shaheer and set the group permissions to the group Oracle, use chown (-R will change ownership of all files and subdirectories under the directory project:
[root@badar /]# chown –R Shaheer:Oracle /project



Comments

Popular posts from this blog

What is Oracle Integration Cloud Service - ICS?

How to Create Packages in Oracle Database using TOAD for Oracle

How to create a Simple Scheduler Job in Oracle Database using Toad