Note
The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.
Difference between revisions of "File permissions"
Jump to navigation
Jump to search
(Created page with "== chmod == You can change file permissions with: <console>$ chmod [r][g][u] [file]</console> [r] = number for root permissions, [g] = number for group permissions and [u] = n...") |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== | == Add user == | ||
You can change file permissions with | <console> | ||
<console>$ chmod | ###i## useradd -g users -G wheel,portage,audio,video,usb,cdrom,tty -m <username> | ||
</console> | |||
== Delete user == | |||
<console> | |||
###i## userder -r <username> | |||
</console> | |||
== List groups == | |||
$##bl## groups | |||
$##bl## groups <username> | |||
== List users == | |||
$##bl## users | |||
== Add user to group == | |||
###i## gpasswd -a <user> <group> | |||
== Remove user from group == | |||
###i## gpasswd -d <user> <group> | |||
== Add new group == | |||
###i## groupadd <group> | |||
== Delete group == | |||
###i## groupdel <group> | |||
== File permissions == | |||
You can change file permissions with chmod. | |||
<console> | |||
$##bl## chmod <r><g><u> <file> | |||
</console> | |||
<r> = number for root permissions | |||
<g> = number for group permissions | |||
<u> = number for user permissions | |||
<pre>7 = 4+2+1 (read/write/execute) | <pre>7 = 4+2+1 (read/write/execute) | ||
6 = 4+2 (read/write) | 6 = 4+2 (read/write) | ||
Line 11: | Line 44: | ||
1 = 1 (execute)</pre> | 1 = 1 (execute)</pre> | ||
== | == Change owner and group of file == | ||
You can change owner and group of file with | You can change owner and group of file with chown. | ||
<console># chown | <console> | ||
###i## chown <user>:<group> <file> | |||
</console> | |||
You can change owner of folder and files inside recursively with: | You can change owner of folder and files inside recursively with: | ||
<console># chown -R | <console> | ||
###i## chown -R <user>:<group> <folder> | |||
</console> | |||
< | |||
< | |||
[[Category:HOWTO]] | [[Category:HOWTO]] | ||
[[Category:First Steps]] |
Revision as of 20:52, September 25, 2014
Add user
root # useradd -g users -G wheel,portage,audio,video,usb,cdrom,tty -m <username>
Delete user
root # userder -r <username>
List groups
$##bl## groups $##bl## groups <username>
List users
$##bl## users
Add user to group
- i## gpasswd -a <user> <group>
Remove user from group
- i## gpasswd -d <user> <group>
Add new group
- i## groupadd <group>
Delete group
- i## groupdel <group>
File permissions
You can change file permissions with chmod.
user $ chmod <r><g><u> <file>
<r> = number for root permissions <g> = number for group permissions = 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)
Change owner and group of file
You can change owner and group of file with chown.
root # chown <user>:<group> <file>
You can change owner of folder and files inside recursively with:
root # chown -R <user>:<group> <folder>