Difference between pages "User:Menelkir" and "File permissions"

(Difference between pages)
(Created page with "{{Person |Full name=Daniel de Oliveira |Email=menelkir@itroll.org |Nick=Menelkir |Geoloc=-23.5776034, -46.642838299999994 |Location name=Brazil |Roles={{Role |Role type=User |...")
 
 
Line 1: Line 1:
{{Person
+
== chmod ==
|Full name=Daniel de Oliveira
+
You can change file permissions with:
|Email=menelkir@itroll.org
+
<console>
|Nick=Menelkir
+
$##bl## chmod [r][g][u] [file]
|Geoloc=-23.5776034, -46.642838299999994
+
</console>
|Location name=Brazil
+
[r] = number for root permissions, [g] = number for group permissions and [u] = number for user permissions.
|Roles={{Role
+
<pre>7 = 4+2+1 (read/write/execute)
|Role type=User
+
6 = 4+2 (read/write)
|Role desc=Sysadmin/Developer/Consultant
+
5 = 4+1 (read/execute)
|Start date=2008/12/29
+
4 = 4 (read)
}}
+
3 = 2+1 (write/execute)
|Maintains=
+
2 = 2 (write)
|Blogs={{Blog
+
1 = 1 (execute)</pre>
|Name=Daniel Menelkir
+
 
|URL=http://menelkir.itroll.org
+
== chown ==
}}
+
You can change owner and group of file with:
}}
+
<console>
 +
###i## chown [user]:[group] [file]
 +
</console>
 +
You can change owner of folder and files inside recursively with:
 +
<console>
 +
###i## chown -R [user]:[group] [folder]
 +
</console>
 +
 
 +
== gpasswd ==
 +
You can add user to group with:
 +
<console>
 +
###i## gpasswd -a [user] [group]
 +
</console>
 +
You can remove a user from a group with:
 +
<console>
 +
###i## gpasswd -d [user] [group]
 +
</console>
 +
 
 +
== useradd ==
 +
You can add a new user with:
 +
<console>
 +
###i## useradd -g users -G wheel,audio,portage -m [user]
 +
###i## passwd [user]
 +
</console>
 +
You can delete a user with:
 +
<console>
 +
###i## userdel [user]
 +
</console>
 +
 
 +
== groupadd ==
 +
You can add a new group with:
 +
<console>
 +
###i## groupadd [group]
 +
</console>
 +
You can delete a group with:
 +
<console>
 +
###i## groupdel [group]
 +
</console>
 +
 
 +
[[Category:HOWTO]]
 +
[[Category:First Steps]]

Revision as of 19:29, March 4, 2014

chmod

You can change file permissions with:

$ chmod [r][g][u] [file]

[r] = number for root permissions, [g] = number for group permissions and [u] = number for user permissions.

7 = 4+2+1 (read/write/execute)
6 = 4+2 (read/write)
5 = 4+1 (read/execute)
4 = 4 (read)
3 = 2+1 (write/execute)
2 = 2 (write)
1 = 1 (execute)

chown

You can change owner and group of file with:

# chown [user]:[group] [file]

You can change owner of folder and files inside recursively with:

# chown -R [user]:[group] [folder]

gpasswd

You can add user to group with:

# gpasswd -a [user] [group]

You can remove a user from a group with:

# gpasswd -d [user] [group]

useradd

You can add a new user with:

# useradd -g users -G wheel,audio,portage -m [user]
# passwd [user]

You can delete a user with:

# userdel [user]

groupadd

You can add a new group with:

# groupadd [group]

You can delete a group with:

# groupdel [group]