Saturday, July 25, 2009

Permissions,Ownerships,users and groups

# chown user1 file1
>> change owner of a file to user1

# chown -R user1:group directory1
>> change owner and group of a directory and all the contents inside it

# chgrp group1 file1
>> change group of files

# chmod ugo+rwx directory1
>> set permissions

read (r),
write (w)
execute (x)


owner (u)
group (g)
others (o)

# chmod go-rwx directory1
>> remove permits (rwx) from users (g0)

# ls -lh
>> permits on files

# groupadd [group]
>> create a new group

# groupdel [group]
>> delete a group

# groupmod -n dba oinstall
>> rename a group from dba to oinstall

# useradd -g dba -d /home/applmgr -s /bin/bash applmgr

>> create a new user "applmgr" belongs "dba" group with home directory /home/applmgr and default shell /bin/bash

# userdel -r oracle
>> delete a user oracle

No comments:

Post a Comment