Aula 07: Usuários, Grupos e Permissões
groups
/etc/passwd
/etc/group
r
w
x
ls -l
chmod permissoes arquivos
rwx
101
100
+
-
u
g
o
a
a+x
go-x
home
tarefa
arq1
arq2
arq3
# adduser nome
# passwd nome
/home/nome
# deluser nome
usermod
$ su - nome
$ su -
root
man su
# groupadd nome
# groupdel nome
# groupmod -n novo velho
# usermod -aG grupo usuario
# gpasswd --delete usuario grupo
sudo
su -
$ su - # apt update # apt full-upgrade # apt install sudo
exit
sudo apt update
visudo
$ su - # visudo
# # This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file. # # See the man page for details on how to write a sudoers file. # Defaults env_reset Defaults mail_badpass Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" # Host alias specification # User alias specification # Cmnd alias specification # User privilege specification root ALL=(ALL:ALL) ALL # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL # See sudoers(5) for more information on "@include" directives: @includedir /etc/sudoers.d
/etc/sudoers
%
# usermod -aG sudo usuario # exit $ exit
$ groups
$ sudo apt update
visitante
john
1234
alunos
# rm -rf /home/usuario