Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [liveuser@localhost ~]$ setxkbmap latam
- [liveuser@localhost ~]$ addgroup
- bash: addgroup: command not found...
- [liveuser@localhost ~]$ groupadd
- bash: /usr/sbin/groupadd: Permission denied
- [liveuser@localhost ~]$ sudo groupadd
- We trust you have received the usual lecture from the local System
- Administrator. It usually boils down to these three things:
- #1) Respect the privacy of others.
- #2) Think before you type.
- #3) With great power comes great responsibility.
- Usage: groupadd [options] GROUP
- Options:
- -f, --force exit successfully if the group already exists,
- and cancel -g if the GID is already used
- -g, --gid GID use GID for the new group
- -h, --help display this help message and exit
- -K, --key KEY=VALUE override /etc/login.defs defaults
- -o, --non-unique allow to create groups with duplicate
- (non-unique) GID
- -p, --password PASSWORD use this encrypted password for the new group
- -r, --system create a system account
- -R, --root CHROOT_DIR directory to chroot into
- [liveuser@localhost ~]$ groupadd oficina1
- bash: /usr/sbin/groupadd: Permission denied
- [liveuser@localhost ~]$ sudo groupadd oficina1
- [liveuser@localhost ~]$ sudo groupadd oficina2
- [liveuser@localhost ~]$ useradd paco
- bash: /usr/sbin/useradd: Permission denied
- [liveuser@localhost ~]$ sudo useradd paco
- [liveuser@localhost ~]$
- [liveuser@localhost ~]$ sudo useradd pablo
- [liveuser@localhost ~]$ sudo useradd
- Usage: useradd [options] LOGIN
- useradd -D
- useradd -D [options]
- Options:
- -b, --base-dir BASE_DIR base directory for the home directory of the
- new account
- -c, --comment COMMENT GECOS field of the new account
- -d, --home-dir HOME_DIR home directory of the new account
- -D, --defaults print or change default useradd configuration
- -e, --expiredate EXPIRE_DATE expiration date of the new account
- -f, --inactive INACTIVE password inactivity period of the new account
- -g, --gid GROUP name or ID of the primary group of the new
- account
- -G, --groups GROUPS list of supplementary groups of the new
- account
- -h, --help display this help message and exit
- -k, --skel SKEL_DIR use this alternative skeleton directory
- -K, --key KEY=VALUE override /etc/login.defs defaults
- -l, --no-log-init do not add the user to the lastlog and
- faillog databases
- -m, --create-home create the user's home directory
- -M, --no-create-home do not create the user's home directory
- -N, --no-user-group do not create a group with the same name as
- the user
- -o, --non-unique allow to create users with duplicate
- (non-unique) UID
- -p, --password PASSWORD encrypted password of the new account
- -r, --system create a system account
- -R, --root CHROOT_DIR directory to chroot into
- -s, --shell SHELL login shell of the new account
- -u, --uid UID user ID of the new account
- -U, --user-group create a group with the same name as the user
- -Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping
- [liveuser@localhost ~]$ sudo useradd -D paco
- Usage: useradd [options] LOGIN
- useradd -D
- useradd -D [options]
- Options:
- -b, --base-dir BASE_DIR base directory for the home directory of the
- new account
- -c, --comment COMMENT GECOS field of the new account
- -d, --home-dir HOME_DIR home directory of the new account
- -D, --defaults print or change default useradd configuration
- -e, --expiredate EXPIRE_DATE expiration date of the new account
- -f, --inactive INACTIVE password inactivity period of the new account
- -g, --gid GROUP name or ID of the primary group of the new
- account
- -G, --groups GROUPS list of supplementary groups of the new
- account
- -h, --help display this help message and exit
- -k, --skel SKEL_DIR use this alternative skeleton directory
- -K, --key KEY=VALUE override /etc/login.defs defaults
- -l, --no-log-init do not add the user to the lastlog and
- faillog databases
- -m, --create-home create the user's home directory
- -M, --no-create-home do not create the user's home directory
- -N, --no-user-group do not create a group with the same name as
- the user
- -o, --non-unique allow to create users with duplicate
- (non-unique) UID
- -p, --password PASSWORD encrypted password of the new account
- -r, --system create a system account
- -R, --root CHROOT_DIR directory to chroot into
- -s, --shell SHELL login shell of the new account
- -u, --uid UID user ID of the new account
- -U, --user-group create a group with the same name as the user
- -Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping
- [liveuser@localhost ~]$ sudo useradd paco -G oficina1
- useradd: user 'paco' already exists
- [liveuser@localhost ~]$ sudo adduser paco oficina1
- Usage: adduser [options] LOGIN
- adduser -D
- adduser -D [options]
- Options:
- -b, --base-dir BASE_DIR base directory for the home directory of the
- new account
- -c, --comment COMMENT GECOS field of the new account
- -d, --home-dir HOME_DIR home directory of the new account
- -D, --defaults print or change default useradd configuration
- -e, --expiredate EXPIRE_DATE expiration date of the new account
- -f, --inactive INACTIVE password inactivity period of the new account
- -g, --gid GROUP name or ID of the primary group of the new
- account
- -G, --groups GROUPS list of supplementary groups of the new
- account
- -h, --help display this help message and exit
- -k, --skel SKEL_DIR use this alternative skeleton directory
- -K, --key KEY=VALUE override /etc/login.defs defaults
- -l, --no-log-init do not add the user to the lastlog and
- faillog databases
- -m, --create-home create the user's home directory
- -M, --no-create-home do not create the user's home directory
- -N, --no-user-group do not create a group with the same name as
- the user
- -o, --non-unique allow to create users with duplicate
- (non-unique) UID
- -p, --password PASSWORD encrypted password of the new account
- -r, --system create a system account
- -R, --root CHROOT_DIR directory to chroot into
- -s, --shell SHELL login shell of the new account
- -u, --uid UID user ID of the new account
- -U, --user-group create a group with the same name as the user
- -Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping
- [liveuser@localhost ~]$ sudo addgroup oficina1
- sudo: addgroup: command not found
- [liveuser@localhost ~]$ sudo groupadd oficina1
- groupadd: group 'oficina1' already exists
- [liveuser@localhost ~]$ sudo adduser paco oficina1
- Usage: adduser [options] LOGIN
- adduser -D
- adduser -D [options]
- Options:
- -b, --base-dir BASE_DIR base directory for the home directory of the
- new account
- -c, --comment COMMENT GECOS field of the new account
- -d, --home-dir HOME_DIR home directory of the new account
- -D, --defaults print or change default useradd configuration
- -e, --expiredate EXPIRE_DATE expiration date of the new account
- -f, --inactive INACTIVE password inactivity period of the new account
- -g, --gid GROUP name or ID of the primary group of the new
- account
- -G, --groups GROUPS list of supplementary groups of the new
- account
- -h, --help display this help message and exit
- -k, --skel SKEL_DIR use this alternative skeleton directory
- -K, --key KEY=VALUE override /etc/login.defs defaults
- -l, --no-log-init do not add the user to the lastlog and
- faillog databases
- -m, --create-home create the user's home directory
- -M, --no-create-home do not create the user's home directory
- -N, --no-user-group do not create a group with the same name as
- the user
- -o, --non-unique allow to create users with duplicate
- (non-unique) UID
- -p, --password PASSWORD encrypted password of the new account
- -r, --system create a system account
- -R, --root CHROOT_DIR directory to chroot into
- -s, --shell SHELL login shell of the new account
- -u, --uid UID user ID of the new account
- -U, --user-group create a group with the same name as the user
- -Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping
- [liveuser@localhost ~]$ sudo adduser -D paco oficina1
- Usage: adduser [options] LOGIN
- adduser -D
- adduser -D [options]
- Options:
- -b, --base-dir BASE_DIR base directory for the home directory of the
- new account
- -c, --comment COMMENT GECOS field of the new account
- -d, --home-dir HOME_DIR home directory of the new account
- -D, --defaults print or change default useradd configuration
- -e, --expiredate EXPIRE_DATE expiration date of the new account
- -f, --inactive INACTIVE password inactivity period of the new account
- -g, --gid GROUP name or ID of the primary group of the new
- account
- -G, --groups GROUPS list of supplementary groups of the new
- account
- -h, --help display this help message and exit
- -k, --skel SKEL_DIR use this alternative skeleton directory
- -K, --key KEY=VALUE override /etc/login.defs defaults
- -l, --no-log-init do not add the user to the lastlog and
- faillog databases
- -m, --create-home create the user's home directory
- -M, --no-create-home do not create the user's home directory
- -N, --no-user-group do not create a group with the same name as
- the user
- -o, --non-unique allow to create users with duplicate
- (non-unique) UID
- -p, --password PASSWORD encrypted password of the new account
- -r, --system create a system account
- -R, --root CHROOT_DIR directory to chroot into
- -s, --shell SHELL login shell of the new account
- -u, --uid UID user ID of the new account
- -U, --user-group create a group with the same name as the user
- -Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping
- [liveuser@localhost ~]$ groups
- liveuser wheel
- [liveuser@localhost ~]$ ls /home
- liveuser pablo paco
- [liveuser@localhost ~]$ su
- [root@localhost liveuser]# deleteuser
- bash: deleteuser: command not found...
- [root@localhost liveuser]# man useradd
- [root@localhost liveuser]# userdel paco
- [root@localhost liveuser]# userdel pablo
- [root@localhost liveuser]# groupdel oficina1
- [root@localhost liveuser]# groupdel oficina2
- [root@localhost liveuser]# ls
- Desktop Documents Downloads Music Pictures Public Templates Videos
- [root@localhost liveuser]# ls /
- bin boot dev etc home lib lib64 lost+found media mnt opt proc root run sbin srv sys tmp usr var
- [root@localhost liveuser]# ls /home
- liveuser pablo paco
- [root@localhost liveuser]# rm -rf /home/paco/
- [root@localhost liveuser]# rm -rf /home/pablo/
- [root@localhost liveuser]# ls /home
- liveuser
- [root@localhost liveuser]# man a
- Display all 232 possibilities? (y or n)
- [root@localhost liveuser]# man add
- addgnupghome add_key addmntent addpart addseverity adduser
- [root@localhost liveuser]# man adduser
- [root@localhost liveuser]# adduser paco -G oficina1
- adduser: group 'oficina1' does not exist
- [root@localhost liveuser]# groupadd oficina1
- [root@localhost liveuser]# groupadd oficina2
- [root@localhost liveuser]# adduser paco -G oficina1
- Creating mailbox file: File exists
- [root@localhost liveuser]# rm -rf /var/spool/mail
- [root@localhost liveuser]# adduser paco -G oficina1
- adduser: user 'paco' already exists
- [root@localhost liveuser]# adduser pablo -G oficina1
- Creating mailbox file: No such file or directory
- [root@localhost liveuser]# touch /var/spool/mail
- [root@localhost liveuser]# adduser pablo -G oficina1
- adduser: user 'pablo' already exists
- [root@localhost liveuser]# groups
- root
- [root@localhost liveuser]# man groups
- [root@localhost liveuser]# groups paco
- paco : paco oficina1
- [root@localhost liveuser]# groups pablo
- pablo : pablo oficina1
- [root@localhost liveuser]# adduser alba -G oficina2
- Creating mailbox file: Not a directory
- [root@localhost liveuser]# touch /var/spool/mail
- [root@localhost liveuser]# adduser alba -G oficina2
- adduser: user 'alba' already exists
- [root@localhost liveuser]# touch /var/spool/mail
- [root@localhost liveuser]# adduser nerea -G oficina2
- Creating mailbox file: Not a directory
- [root@localhost liveuser]# touch /var/spool/mail
- [root@localhost liveuser]# paco
- bash: paco: command not found...
- [root@localhost liveuser]# passwd paco
- Changing password for user paco.
- New password:
- BAD PASSWORD: The password fails the dictionary check - it is too simplistic/systematic
- Retype new password:
- Sorry, passwords do not match.
- New password:
- BAD PASSWORD: The password is shorter than 8 characters
- Retype new password:
- passwd: all authentication tokens updated successfully.
- [root@localhost liveuser]# sudo
- usage: sudo -h | -K | -k | -V
- usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
- usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
- usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-u user] [VAR=value] [-i|-s] [<command>]
- usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-u user] file ...
- [root@localhost liveuser]# exit
- exit
- [liveuser@localhost ~]$ su - paco
- Password:
- Last login: Mon May 2 06:40:04 EDT 2016 on tty2
- [paco@localhost ~]$ setxkbmap latam
- [paco@localhost ~]$ ls
- topsecret.txt
- [paco@localhost ~]$ nano
- bash: nano: command not found...
- [paco@localhost ~]$ sudo dnf install nano
- We trust you have received the usual lecture from the local System
- Administrator. It usually boils down to these three things:
- #1) Respect the privacy of others.
- #2) Think before you type.
- #3) With great power comes great responsibility.
- [sudo] password for paco:
- paco is not in the sudoers file. This incident will be reported.
- [paco@localhost ~]$ ls
- topsecret.txt
- [paco@localhost ~]$ vi topsecret.txt
- [paco@localhost ~]$ chmod 600 topsecret.txt
- [paco@localhost ~]$ su
- [root@localhost paco]# exit
- exit
- [paco@localhost ~]$ touch topsecret.txt
- [paco@localhost ~]$ ls -l
- total 0
- -rw-------. 1 paco paco 0 May 2 06:48 topsecret.txt
- [paco@localhost ~]$ su - pablo
- Password:
- [paco@localhost ~]$ su
- [root@localhost paco]# passwd pablo
- Changing password for user pablo.
- New password:
- BAD PASSWORD: The password is shorter than 8 characters
- Retype new password:
- Sorry, passwords do not match.
- New password:
- BAD PASSWORD: The password is shorter than 8 characters
- Retype new password:
- passwd: all authentication tokens updated successfully.
- [root@localhost paco]# exit
- exit
- [paco@localhost ~]$ su - pablo
- Password:
- [pablo@localhost ~]$ cd /home/paco/
- -bash: cd: /home/paco/: Permission denied
- [pablo@localhost ~]$ su
- [root@localhost pablo]# cd /home/paco
- [root@localhost paco]# nano topsecret.txt
- bash: nano: command not found...
- [root@localhost paco]# vi topsecret.txt
- [root@localhost paco]# cat topsecret.txt
- ayy
- [root@localhost paco]# su - paco
- Last login: Mon May 2 06:42:34 EDT 2016 on pts/0
- [paco@localhost ~]$ vi ventas_trimestre.txt
- [paco@localhost ~]$ chmod 770 ventas_trimestre.txt
- [paco@localhost ~]$ su - pablo
- Password:
- Last login: Mon May 2 06:49:42 EDT 2016 on pts/0
- [pablo@localhost ~]$ cd /home/paco/
- -bash: cd: /home/paco/: Permission denied
- [pablo@localhost ~]$ sudo cd /home/paco/
- We trust you have received the usual lecture from the local System
- Administrator. It usually boils down to these three things:
- #1) Respect the privacy of others.
- #2) Think before you type.
- #3) With great power comes great responsibility.
- [sudo] password for pablo:
- [pablo@localhost ~]$ sudo cd /home/paco/ventas_trimestre
- We trust you have received the usual lecture from the local System
- Administrator. It usually boils down to these three things:
- #1) Respect the privacy of others.
- #2) Think before you type.
- #3) With great power comes great responsibility.
- [sudo] password for pablo:
- [pablo@localhost ~]$ su
- [root@localhost pablo]# passwd alba
- Changing password for user alba.
- New password:
- BAD PASSWORD: The password is shorter than 8 characters
- Retype new password:
- passwd: all authentication tokens updated successfully.
- [root@localhost pablo]# su - alba
- [alba@localhost ~]$ vi empleados.txt
- [alba@localhost ~]$ chmod ugo+r,g+w empleados.txt
- chmod: cannot access ‘empleados.txt’: No such file or directory
- [alba@localhost ~]$ ls
- [alba@localhost ~]$ touch empleados.txt
- [alba@localhost ~]$ chmod ugo+r,g+w empleados.txt
- [alba@localhost ~]$ su - paco
- Password:
- Last login: Mon May 2 06:51:22 EDT 2016 on pts/0
- [paco@localhost ~]$ vi /home/alba/empleados.txt
- [paco@localhost ~]$ su
- [root@localhost paco]# passwd nerea
- Changing password for user nerea.
- New password:
- BAD PASSWORD: The password is shorter than 8 characters
- Retype new password:
- passwd: all authentication tokens updated successfully.
- [root@localhost paco]# su - nerea
- [nerea@localhost ~]$ vi /home/alba/empleados.txt
- [nerea@localhost ~]$ su - alba
- Password:
- Last login: Mon May 2 06:54:15 EDT 2016 on pts/0
- [alba@localhost ~]$ chmod g+w empleados.txt
- [alba@localhost ~]$ su - nerea
- Password:
- Last login: Mon May 2 06:59:22 EDT 2016 on pts/0
- [nerea@localhost ~]$ sudo /home/alba/empleados.txt
- We trust you have received the usual lecture from the local System
- Administrator. It usually boils down to these three things:
- #1) Respect the privacy of others.
- #2) Think before you type.
- #3) With great power comes great responsibility.
- [sudo] password for nerea:
- [nerea@localhost ~]$ vi /home/alba/empleados.txt
- [nerea@localhost ~]$ su - alba
- Password:
- Last login: Mon May 2 07:00:05 EDT 2016 on pts/0
- [alba@localhost ~]$ ls -l
- total 0
- -rw-rw-r--. 1 alba alba 0 May 2 06:58 empleados.txt
- [alba@localhost ~]$ chmod g+w empleados.txt
- [alba@localhost ~]$ ls -l
- total 0
- -rw-rw-r--. 1 alba alba 0 May 2 06:58 empleados.txt
- [alba@localhost ~]$ chmod o+w empleados.txt
- [alba@localhost ~]$ chmod o-w empleados.txt
- [alba@localhost ~]$ ls -l
- total 0
- -rw-rw-r--. 1 alba alba 0 May 2 06:58 empleados.txt
- [alba@localhost ~]$ su
- [root@localhost alba]# groups oficina2
- groups: oficina2: no such user
- [root@localhost alba]# groups nerea
- nerea : nerea oficina2
- [root@localhost alba]# groups alba
- alba : alba oficina2
- [root@localhost alba]# chmod u=rw,g=r,o=r empleados.txt
- [root@localhost alba]# su - nerea
- Last login: Mon May 2 07:00:29 EDT 2016 on pts/0
- [nerea@localhost ~]$ sudo /home/alba/empleados.txt
- We trust you have received the usual lecture from the local System
- Administrator. It usually boils down to these three things:
- #1) Respect the privacy of others.
- #2) Think before you type.
- #3) With great power comes great responsibility.
- [sudo] password for nerea:
- [nerea@localhost ~]$ vi /home/alba/empleados.txt
- [nerea@localhost ~]$ su - alba
- Password:
- Last login: Mon May 2 07:01:05 EDT 2016 on pts/0
- [alba@localhost ~]$ ls -l
- total 0
- -rw-r--r--. 1 alba alba 0 May 2 06:58 empleados.txt
- [alba@localhost ~]$ chmod 764 empleados.txt
- [alba@localhost ~]$ ls -l
- total 0
- -rwxrw-r--. 1 alba alba 0 May 2 06:58 empleados.txt
- [alba@localhost ~]$ su - nerea
- Password:
- Last login: Mon May 2 07:06:38 EDT 2016 on pts/0
- [nerea@localhost ~]$ vi /home/alba/empleado.txt
- [nerea@localhost ~]$ vi /home/alba/empleados.txt
- [nerea@localhost ~]$ ls /home/alba
- ls: cannot open directory /home/alba: Permission denied
- [nerea@localhost ~]$ ^C
- [nerea@localhost ~]$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement