Examen SI 2 Ev-Resuelto
Examen SI 2 Ev-Resuelto
Examen SI 2 Ev-Resuelto
En VirtualBox, tienes creada 1 máquina virtual con Ubuntu de escritorio 20.04 llamada “Ubuntu-SI-DAM” tiene
1 tarjeta de red en NAT.
- Crea tres usuarios llamados linux1, linux2 y linux3 y 2 grupos llamados trabajo y acceso - Lilnux1 y linux2
pertenecen al grupo trabajo. Linux3 pertenece al grupo acceso
- En tu directorio /home, crea una carpeta llamada compartida, y haz que el grupo trabajo, pueda leer y
escribir en esa carpeta.
Pasos:
1. Crear usuarios:
o sudo useradd -m linux1
o sudo useradd -m linux2
o sudo useradd -m linux3
2. Crear grupos:
o sudo groupadd trabajo
o sudo groupadd acceso
3. Asignar usuarios a grupos:
o sudo usermod -aG trabajo linux1
o sudo usermod -aG trabajo linux2
o sudo usermod -aG acceso linux3
4. Crear carpeta compartida:
o mkdir ~/compartida
o ó $HOME/compartida
5. Permisos para el grupo "trabajo":
o sudo chgrp -R trabajo ~/compartida
This command changes the group ownership of the directory ~/compartida and all its contents to the group
named trabajo. The -R flag instructs the chgrp command to recursively apply the group ownership change
to all subdirectories and files within ~/compartida.
Explanation:
• sudo: This command prefix elevates the privileges to execute the command with root permissions.
It's necessary since changing group ownership may require administrative privileges.
• chgrp: This command is used to change the group ownership of files and directories.
• -R: This flag tells chgrp to operate recursively, meaning it will change the group ownership of all files
and subdirectories within the specified directory.
• trabajo: This is the name of the group to which the ownership of ~/compartida and its contents will
be changed.
• ~/compartida: This is the path to the directory whose group ownership is being changed.
This command changes the file permissions of the directory ~/compartida and all its contents to 775. The -R
flag instructs the chmod command to recursively apply the permission changes to all subdirectories and files
within ~/compartida.
Explanation:
• sudo: Same as in the previous command, it elevates the command to execute with root privileges.
• chmod: This command is used to change the file permissions of files and directories.
• -R:This flag tells chmod to operate recursively, meaning it will change the permissions of all files and
subdirectories within the specified directory.
• 775: This is the octal number representing the desired file permissions:
o 7: The first digit (7) represents the permissions for the directory owner: read, write, and
execute (rwx).
o 7: The second digit (7) represents the permissions for the group members: read, write, and
execute (rwx).
o 5: The third digit (5) represents the permissions for other users: read and execute (rx).
Pregunta 6. Comandos:
- Sitúate en tu directorio home, y crea un directorio llamado examen, y dentro de él tres archivos vacíos. - Crea
un nuevo directorio llamado mover, y mueve a él los archivos creados en el punto anterior.
- Crea un nuevo directorio dentro de examen llamado copia, y copia en él todos los archivos del directorio /etc -
Haz una copia de seguridad del directorio examen en un archivo comprimido llamado examen.tar.gz.
Pasos:
En Ubuntu arrancamos el editor de textos gedit desde una terminal (term). Con que comando identificas el
proceso, su PID, y el identificador del proceso padre, para finalizar termina el proceso
Comando:
Explicación:
Comando: