Olhar

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 4

Abner Pereira/Isabela Marin/Raquel Santana/Thiago Unger

1)
C:\Users\Etec>wsl --user root

2)
root@LAB258-02:/mnt/c/Users/Etec# cd /home
root@LAB258-02:/home# mkdir so_2

3)
root@LAB258-02:/home# cd so_2
root@LAB258-02:/home/so_2# mkdir dir_01 dir_02

4)
root@LAB258-02:/home/so_2# cat > file_01.txt
Don't call me white...
Don't call me white!
^Z
[1]+ Stopped cat > file_01.txt
root@LAB258-02:/home/so_2# cat > file_02.txt
Diretoria tá de pé
Aí mané olha a revolta
Do moleque sofredor
^Z
[2]+ Stopped cat > file_02.txt
root@LAB258-02:/home/so_2# cat > file_03.txt
Uma luz azul me guia
Com a firmeza e os lampejos do farol
E os recifes lá de cima
Me avisam dos perigos de chegar
^Z
[3]+ Stopped cat > file_03.txt

root@LAB258-02:/home/so_2# cp file_* dir_01


root@LAB258-02:/home/so_2# cp file_* dir_02

5)
root@LAB258-02:/home/so_2# cd dir_01
root@LAB258-02:/home/so_2/dir_01# mv file_01.txt file_04.txt
root@LAB258-02:/home/so_2/dir_01# mv file_02.txt file_05.txt
root@LAB258-02:/home/so_2/dir_01# mv file_03.txt file_06.txt

6)
root@LAB258-02:/home/so_2/dir_01# cd ..
root@LAB258-02:/home/so_2# cd dir_02
root@LAB258-02:/home/so_2/dir_02# mv file_01.txt file_07.txt
root@LAB258-02:/home/so_2/dir_02# mv file_02.txt file_08.txt
root@LAB258-02:/home/so_2/dir_02# mv file_03.txt file_09.txt

7)
root@LAB258-02:/home/so_2/dir_02# adduser tim_maia
Adding user `tim_maia' ...
Adding new group `tim_maia' (1001) ...
Adding new user `tim_maia' (1001) with group `tim_maia' ...
Creating home directory `/home/tim_maia' ...
Copying files from `/etc/skel' ...
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for tim_maia
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y
root@LAB258-02:/home/so_2/dir_02# adduser mc_primo
Adding user `mc_primo' ...
Adding new group `mc_primo' (1002) ...
Adding new user `mc_primo' (1002) with group `mc_primo' ...
Creating home directory `/home/mc_primo' ...
Copying files from `/etc/skel' ...
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for mc_primo
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y

8)
root@LAB258-02:/home# useradd -m djavan

9)
root@LAB258-02:/home# passwd -d djavan
passwd: password expiry information changed.
root@LAB258-02:/home# passwd -e djavan
passwd: password expiry information changed.

10)
root@LAB258-02:/home# passwd -x20 tim_maia
passwd: password expiry information changed.
root@LAB258-02:/home# passwd -x20 mc_primo
passwd: password expiry information changed.

11)
root@LAB258-02:/home# addgroup tropicalia
Adding group `tropicalia' (GID 1004) ...
Done.
root@LAB258-02:/home# usermod -aG tropicalia djavan
root@LAB258-02:/home# usermod -aG tropicalia mc_primo
root@LAB258-02:/home# cat /etc/group | grep tropicalia
tropicalia:x:1004:djavan,mc_primo

12)
root@LAB258-02:/home# usermod -aG sudo djavan

13)
root@LAB258-02:/home# cat /etc/group | grep sudo

14)
root@LAB258-02:/home# su djavan
You are required to change your password immediately (administrator enforced).
New password:
Retype new password:

15)
$ cd so_2
$ sudo chown mc_primo dir_01
[sudo] password for djavan:
$ sudo chgrp tropicalia dir_01

16)
$ cd ..
$ pwd
/home/so_2
$ sudo chmod 775 dir_01
$ ls -l
total 20
drwxrwxr-x 2 mc_primo tropicalia 4096 Apr 20 15:22 dir_01
...

17)
$ sudo chmod 744 dir_02
$ ls -l
total 20
drwxrwxr-x 2 mc_primo tropicalia 4096 Apr 20 15:22 dir_01
drwxr--r-- 2 root root 4096 Apr 20 15:24 dir_02
...

18)
$ pwd
/home/so_2
$ sudo chmod 777 file_*.txt
$ ls -l
total 20
drwxrwxr-x 2 mc_primo tropicalia 4096 Apr 20 15:22 dir_01
drwxr--r-- 2 root root 4096 Apr 20 15:24 dir_02
-rwxrwxrwx 1 root root 44 Apr 20 15:12 file_01.txt
-rwxrwxrwx 1 root root 66 Apr 20 15:13 file_02.txt
-rwxrwxrwx 1 root root 115 Apr 20 15:14 file_03.txt

19)
root@LAB258-02:/home# su mc_primo

20)
mc_primo@LAB258-02:/home/so_2$ cd dir_01
mc_primo@LAB258-02:/home/so_2/dir_01$ ls -l
total 20
drwxrwxr-x 2 mc_primo tropicalia 4096 Apr 20 15:22 dir_01
drwxr--r-- 2 root root 4096 Apr 20 15:24 dir_02
-rwxrwxrwx 1 root root 44 Apr 20 15:12 file_01.txt
-rwxrwxrwx 1 root root 66 Apr 20 15:13 file_02.txt
-rwxrwxrwx 1 root root 115 Apr 20 15:14 file_03.txt

(Pode apagar, pois tem permissão do grupo 'tropicalia' no diretório pai 'dir_01'.)

21)
mc_primo@LAB258-02:/home/so_2/dir_01$ rm file_05.txt
rm: remove write-protected regular file 'file_05.txt'? y
mc_primo@LAB258-02:/home/so_2/dir_01$ ls
file_04.txt file_06.txt
(Pediu confirmação para apagar o arquivo. O usuário pode apagar pois é proprietário
do diretório pai 'dir_01' e tem permissões para tal.)

22)
mc_primo@LAB258-02:/home/so_2$ cd dir_02
bash: cd: dir_02: Permission denied
mc_primo@LAB258-02:/home/so_2$ ls -l
total 20
drwxrwxr-x 2 mc_primo tropicalia 4096 Apr 20 15:59 dir_01
drwxr--r-- 2 root root 4096 Apr 20 15:24 dir_02
...

(Permissão negada. Usuário não tem permissão para 'executar' 'dir_02'.)

23)
root@LAB258-02:/home# su djavan

24) (A CORRIGIR)
$ sudo chown tim_maia /home/so_2/dir_02
[sudo] password for djavan:
$ cd /home/so_2
$ ls -l
total 20
drwxrwxr-x 2 mc_primo tropicalia 4096 Apr 20 15:59 dir_01
drwxr--r-- 2 tim_maia root 4096 Apr 20 15:24 dir_02
...
$ cd dir_02
sh: 4: cd: can't cd to dir_02

(Não consegue acessar 'dir_02' pois não tem permissão de 'executar' o diretório.)

25)
root@LAB258-02:/home# su tim_maia

26)
tim_maia@LAB258-02:/home$ cd so_2
tim_maia@LAB258-02:/home/so_2$ ls -l
total 20
drwxrwxr-x 2 mc_primo tropicalia 4096 Apr 20 15:59 dir_01
drwxr--r-- 2 tim_maia root 4096 Apr 20 15:24 dir_02
...
[A CORRIGIR]

You might also like