Advertisement
Guest User

Untitled

a guest
May 2nd, 2016
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.25 KB | None | 0 0
  1. [liveuser@localhost ~]$ setxkbmap latam
  2. [liveuser@localhost ~]$ addgroup
  3. bash: addgroup: command not found...
  4. [liveuser@localhost ~]$ groupadd
  5. bash: /usr/sbin/groupadd: Permission denied
  6. [liveuser@localhost ~]$ sudo groupadd
  7.  
  8. We trust you have received the usual lecture from the local System
  9. Administrator. It usually boils down to these three things:
  10.  
  11. #1) Respect the privacy of others.
  12. #2) Think before you type.
  13. #3) With great power comes great responsibility.
  14.  
  15. Usage: groupadd [options] GROUP
  16.  
  17. Options:
  18. -f, --force exit successfully if the group already exists,
  19. and cancel -g if the GID is already used
  20. -g, --gid GID use GID for the new group
  21. -h, --help display this help message and exit
  22. -K, --key KEY=VALUE override /etc/login.defs defaults
  23. -o, --non-unique allow to create groups with duplicate
  24. (non-unique) GID
  25. -p, --password PASSWORD use this encrypted password for the new group
  26. -r, --system create a system account
  27. -R, --root CHROOT_DIR directory to chroot into
  28.  
  29. [liveuser@localhost ~]$ groupadd oficina1
  30. bash: /usr/sbin/groupadd: Permission denied
  31. [liveuser@localhost ~]$ sudo groupadd oficina1
  32. [liveuser@localhost ~]$ sudo groupadd oficina2
  33. [liveuser@localhost ~]$ useradd paco
  34. bash: /usr/sbin/useradd: Permission denied
  35. [liveuser@localhost ~]$ sudo useradd paco
  36. [liveuser@localhost ~]$
  37. [liveuser@localhost ~]$ sudo useradd pablo
  38. [liveuser@localhost ~]$ sudo useradd
  39. Usage: useradd [options] LOGIN
  40. useradd -D
  41. useradd -D [options]
  42.  
  43. Options:
  44. -b, --base-dir BASE_DIR base directory for the home directory of the
  45. new account
  46. -c, --comment COMMENT GECOS field of the new account
  47. -d, --home-dir HOME_DIR home directory of the new account
  48. -D, --defaults print or change default useradd configuration
  49. -e, --expiredate EXPIRE_DATE expiration date of the new account
  50. -f, --inactive INACTIVE password inactivity period of the new account
  51. -g, --gid GROUP name or ID of the primary group of the new
  52. account
  53. -G, --groups GROUPS list of supplementary groups of the new
  54. account
  55. -h, --help display this help message and exit
  56. -k, --skel SKEL_DIR use this alternative skeleton directory
  57. -K, --key KEY=VALUE override /etc/login.defs defaults
  58. -l, --no-log-init do not add the user to the lastlog and
  59. faillog databases
  60. -m, --create-home create the user's home directory
  61. -M, --no-create-home do not create the user's home directory
  62. -N, --no-user-group do not create a group with the same name as
  63. the user
  64. -o, --non-unique allow to create users with duplicate
  65. (non-unique) UID
  66. -p, --password PASSWORD encrypted password of the new account
  67. -r, --system create a system account
  68. -R, --root CHROOT_DIR directory to chroot into
  69. -s, --shell SHELL login shell of the new account
  70. -u, --uid UID user ID of the new account
  71. -U, --user-group create a group with the same name as the user
  72. -Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping
  73.  
  74. [liveuser@localhost ~]$ sudo useradd -D paco
  75. Usage: useradd [options] LOGIN
  76. useradd -D
  77. useradd -D [options]
  78.  
  79. Options:
  80. -b, --base-dir BASE_DIR base directory for the home directory of the
  81. new account
  82. -c, --comment COMMENT GECOS field of the new account
  83. -d, --home-dir HOME_DIR home directory of the new account
  84. -D, --defaults print or change default useradd configuration
  85. -e, --expiredate EXPIRE_DATE expiration date of the new account
  86. -f, --inactive INACTIVE password inactivity period of the new account
  87. -g, --gid GROUP name or ID of the primary group of the new
  88. account
  89. -G, --groups GROUPS list of supplementary groups of the new
  90. account
  91. -h, --help display this help message and exit
  92. -k, --skel SKEL_DIR use this alternative skeleton directory
  93. -K, --key KEY=VALUE override /etc/login.defs defaults
  94. -l, --no-log-init do not add the user to the lastlog and
  95. faillog databases
  96. -m, --create-home create the user's home directory
  97. -M, --no-create-home do not create the user's home directory
  98. -N, --no-user-group do not create a group with the same name as
  99. the user
  100. -o, --non-unique allow to create users with duplicate
  101. (non-unique) UID
  102. -p, --password PASSWORD encrypted password of the new account
  103. -r, --system create a system account
  104. -R, --root CHROOT_DIR directory to chroot into
  105. -s, --shell SHELL login shell of the new account
  106. -u, --uid UID user ID of the new account
  107. -U, --user-group create a group with the same name as the user
  108. -Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping
  109.  
  110. [liveuser@localhost ~]$ sudo useradd paco -G oficina1
  111. useradd: user 'paco' already exists
  112. [liveuser@localhost ~]$ sudo adduser paco oficina1
  113. Usage: adduser [options] LOGIN
  114. adduser -D
  115. adduser -D [options]
  116.  
  117. Options:
  118. -b, --base-dir BASE_DIR base directory for the home directory of the
  119. new account
  120. -c, --comment COMMENT GECOS field of the new account
  121. -d, --home-dir HOME_DIR home directory of the new account
  122. -D, --defaults print or change default useradd configuration
  123. -e, --expiredate EXPIRE_DATE expiration date of the new account
  124. -f, --inactive INACTIVE password inactivity period of the new account
  125. -g, --gid GROUP name or ID of the primary group of the new
  126. account
  127. -G, --groups GROUPS list of supplementary groups of the new
  128. account
  129. -h, --help display this help message and exit
  130. -k, --skel SKEL_DIR use this alternative skeleton directory
  131. -K, --key KEY=VALUE override /etc/login.defs defaults
  132. -l, --no-log-init do not add the user to the lastlog and
  133. faillog databases
  134. -m, --create-home create the user's home directory
  135. -M, --no-create-home do not create the user's home directory
  136. -N, --no-user-group do not create a group with the same name as
  137. the user
  138. -o, --non-unique allow to create users with duplicate
  139. (non-unique) UID
  140. -p, --password PASSWORD encrypted password of the new account
  141. -r, --system create a system account
  142. -R, --root CHROOT_DIR directory to chroot into
  143. -s, --shell SHELL login shell of the new account
  144. -u, --uid UID user ID of the new account
  145. -U, --user-group create a group with the same name as the user
  146. -Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping
  147.  
  148. [liveuser@localhost ~]$ sudo addgroup oficina1
  149. sudo: addgroup: command not found
  150. [liveuser@localhost ~]$ sudo groupadd oficina1
  151. groupadd: group 'oficina1' already exists
  152. [liveuser@localhost ~]$ sudo adduser paco oficina1
  153. Usage: adduser [options] LOGIN
  154. adduser -D
  155. adduser -D [options]
  156.  
  157. Options:
  158. -b, --base-dir BASE_DIR base directory for the home directory of the
  159. new account
  160. -c, --comment COMMENT GECOS field of the new account
  161. -d, --home-dir HOME_DIR home directory of the new account
  162. -D, --defaults print or change default useradd configuration
  163. -e, --expiredate EXPIRE_DATE expiration date of the new account
  164. -f, --inactive INACTIVE password inactivity period of the new account
  165. -g, --gid GROUP name or ID of the primary group of the new
  166. account
  167. -G, --groups GROUPS list of supplementary groups of the new
  168. account
  169. -h, --help display this help message and exit
  170. -k, --skel SKEL_DIR use this alternative skeleton directory
  171. -K, --key KEY=VALUE override /etc/login.defs defaults
  172. -l, --no-log-init do not add the user to the lastlog and
  173. faillog databases
  174. -m, --create-home create the user's home directory
  175. -M, --no-create-home do not create the user's home directory
  176. -N, --no-user-group do not create a group with the same name as
  177. the user
  178. -o, --non-unique allow to create users with duplicate
  179. (non-unique) UID
  180. -p, --password PASSWORD encrypted password of the new account
  181. -r, --system create a system account
  182. -R, --root CHROOT_DIR directory to chroot into
  183. -s, --shell SHELL login shell of the new account
  184. -u, --uid UID user ID of the new account
  185. -U, --user-group create a group with the same name as the user
  186. -Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping
  187.  
  188. [liveuser@localhost ~]$ sudo adduser -D paco oficina1
  189. Usage: adduser [options] LOGIN
  190. adduser -D
  191. adduser -D [options]
  192.  
  193. Options:
  194. -b, --base-dir BASE_DIR base directory for the home directory of the
  195. new account
  196. -c, --comment COMMENT GECOS field of the new account
  197. -d, --home-dir HOME_DIR home directory of the new account
  198. -D, --defaults print or change default useradd configuration
  199. -e, --expiredate EXPIRE_DATE expiration date of the new account
  200. -f, --inactive INACTIVE password inactivity period of the new account
  201. -g, --gid GROUP name or ID of the primary group of the new
  202. account
  203. -G, --groups GROUPS list of supplementary groups of the new
  204. account
  205. -h, --help display this help message and exit
  206. -k, --skel SKEL_DIR use this alternative skeleton directory
  207. -K, --key KEY=VALUE override /etc/login.defs defaults
  208. -l, --no-log-init do not add the user to the lastlog and
  209. faillog databases
  210. -m, --create-home create the user's home directory
  211. -M, --no-create-home do not create the user's home directory
  212. -N, --no-user-group do not create a group with the same name as
  213. the user
  214. -o, --non-unique allow to create users with duplicate
  215. (non-unique) UID
  216. -p, --password PASSWORD encrypted password of the new account
  217. -r, --system create a system account
  218. -R, --root CHROOT_DIR directory to chroot into
  219. -s, --shell SHELL login shell of the new account
  220. -u, --uid UID user ID of the new account
  221. -U, --user-group create a group with the same name as the user
  222. -Z, --selinux-user SEUSER use a specific SEUSER for the SELinux user mapping
  223.  
  224. [liveuser@localhost ~]$ groups
  225. liveuser wheel
  226. [liveuser@localhost ~]$ ls /home
  227. liveuser pablo paco
  228. [liveuser@localhost ~]$ su
  229. [root@localhost liveuser]# deleteuser
  230. bash: deleteuser: command not found...
  231. [root@localhost liveuser]# man useradd
  232. [root@localhost liveuser]# userdel paco
  233. [root@localhost liveuser]# userdel pablo
  234. [root@localhost liveuser]# groupdel oficina1
  235. [root@localhost liveuser]# groupdel oficina2
  236. [root@localhost liveuser]# ls
  237. Desktop Documents Downloads Music Pictures Public Templates Videos
  238. [root@localhost liveuser]# ls /
  239. bin boot dev etc home lib lib64 lost+found media mnt opt proc root run sbin srv sys tmp usr var
  240. [root@localhost liveuser]# ls /home
  241. liveuser pablo paco
  242. [root@localhost liveuser]# rm -rf /home/paco/
  243. [root@localhost liveuser]# rm -rf /home/pablo/
  244. [root@localhost liveuser]# ls /home
  245. liveuser
  246. [root@localhost liveuser]# man a
  247. Display all 232 possibilities? (y or n)
  248. [root@localhost liveuser]# man add
  249. addgnupghome add_key addmntent addpart addseverity adduser
  250. [root@localhost liveuser]# man adduser
  251. [root@localhost liveuser]# adduser paco -G oficina1
  252. adduser: group 'oficina1' does not exist
  253. [root@localhost liveuser]# groupadd oficina1
  254. [root@localhost liveuser]# groupadd oficina2
  255. [root@localhost liveuser]# adduser paco -G oficina1
  256. Creating mailbox file: File exists
  257. [root@localhost liveuser]# rm -rf /var/spool/mail
  258. [root@localhost liveuser]# adduser paco -G oficina1
  259. adduser: user 'paco' already exists
  260. [root@localhost liveuser]# adduser pablo -G oficina1
  261. Creating mailbox file: No such file or directory
  262. [root@localhost liveuser]# touch /var/spool/mail
  263. [root@localhost liveuser]# adduser pablo -G oficina1
  264. adduser: user 'pablo' already exists
  265. [root@localhost liveuser]# groups
  266. root
  267. [root@localhost liveuser]# man groups
  268. [root@localhost liveuser]# groups paco
  269. paco : paco oficina1
  270. [root@localhost liveuser]# groups pablo
  271. pablo : pablo oficina1
  272. [root@localhost liveuser]# adduser alba -G oficina2
  273. Creating mailbox file: Not a directory
  274. [root@localhost liveuser]# touch /var/spool/mail
  275. [root@localhost liveuser]# adduser alba -G oficina2
  276. adduser: user 'alba' already exists
  277. [root@localhost liveuser]# touch /var/spool/mail
  278. [root@localhost liveuser]# adduser nerea -G oficina2
  279. Creating mailbox file: Not a directory
  280. [root@localhost liveuser]# touch /var/spool/mail
  281. [root@localhost liveuser]# paco
  282. bash: paco: command not found...
  283. [root@localhost liveuser]# passwd paco
  284. Changing password for user paco.
  285. New password:
  286. BAD PASSWORD: The password fails the dictionary check - it is too simplistic/systematic
  287. Retype new password:
  288. Sorry, passwords do not match.
  289. New password:
  290. BAD PASSWORD: The password is shorter than 8 characters
  291. Retype new password:
  292. passwd: all authentication tokens updated successfully.
  293. [root@localhost liveuser]# sudo
  294. usage: sudo -h | -K | -k | -V
  295. usage: sudo -v [-AknS] [-g group] [-h host] [-p prompt] [-u user]
  296. usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command]
  297. usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-u user] [VAR=value] [-i|-s] [<command>]
  298. usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-u user] file ...
  299. [root@localhost liveuser]# exit
  300. exit
  301. [liveuser@localhost ~]$ su - paco
  302. Password:
  303. Last login: Mon May 2 06:40:04 EDT 2016 on tty2
  304. [paco@localhost ~]$ setxkbmap latam
  305. [paco@localhost ~]$ ls
  306. topsecret.txt
  307. [paco@localhost ~]$ nano
  308. bash: nano: command not found...
  309. [paco@localhost ~]$ sudo dnf install nano
  310.  
  311. We trust you have received the usual lecture from the local System
  312. Administrator. It usually boils down to these three things:
  313.  
  314. #1) Respect the privacy of others.
  315. #2) Think before you type.
  316. #3) With great power comes great responsibility.
  317.  
  318. [sudo] password for paco:
  319. paco is not in the sudoers file. This incident will be reported.
  320. [paco@localhost ~]$ ls
  321. topsecret.txt
  322. [paco@localhost ~]$ vi topsecret.txt
  323. [paco@localhost ~]$ chmod 600 topsecret.txt
  324. [paco@localhost ~]$ su
  325. [root@localhost paco]# exit
  326. exit
  327. [paco@localhost ~]$ touch topsecret.txt
  328. [paco@localhost ~]$ ls -l
  329. total 0
  330. -rw-------. 1 paco paco 0 May 2 06:48 topsecret.txt
  331. [paco@localhost ~]$ su - pablo
  332. Password:
  333. [paco@localhost ~]$ su
  334. [root@localhost paco]# passwd pablo
  335. Changing password for user pablo.
  336. New password:
  337. BAD PASSWORD: The password is shorter than 8 characters
  338. Retype new password:
  339. Sorry, passwords do not match.
  340. New password:
  341. BAD PASSWORD: The password is shorter than 8 characters
  342. Retype new password:
  343. passwd: all authentication tokens updated successfully.
  344. [root@localhost paco]# exit
  345. exit
  346. [paco@localhost ~]$ su - pablo
  347. Password:
  348. [pablo@localhost ~]$ cd /home/paco/
  349. -bash: cd: /home/paco/: Permission denied
  350. [pablo@localhost ~]$ su
  351. [root@localhost pablo]# cd /home/paco
  352. [root@localhost paco]# nano topsecret.txt
  353. bash: nano: command not found...
  354. [root@localhost paco]# vi topsecret.txt
  355. [root@localhost paco]# cat topsecret.txt
  356. ayy
  357. [root@localhost paco]# su - paco
  358. Last login: Mon May 2 06:42:34 EDT 2016 on pts/0
  359. [paco@localhost ~]$ vi ventas_trimestre.txt
  360. [paco@localhost ~]$ chmod 770 ventas_trimestre.txt
  361. [paco@localhost ~]$ su - pablo
  362. Password:
  363. Last login: Mon May 2 06:49:42 EDT 2016 on pts/0
  364. [pablo@localhost ~]$ cd /home/paco/
  365. -bash: cd: /home/paco/: Permission denied
  366. [pablo@localhost ~]$ sudo cd /home/paco/
  367.  
  368. We trust you have received the usual lecture from the local System
  369. Administrator. It usually boils down to these three things:
  370.  
  371. #1) Respect the privacy of others.
  372. #2) Think before you type.
  373. #3) With great power comes great responsibility.
  374.  
  375. [sudo] password for pablo:
  376. [pablo@localhost ~]$ sudo cd /home/paco/ventas_trimestre
  377.  
  378. We trust you have received the usual lecture from the local System
  379. Administrator. It usually boils down to these three things:
  380.  
  381. #1) Respect the privacy of others.
  382. #2) Think before you type.
  383. #3) With great power comes great responsibility.
  384.  
  385. [sudo] password for pablo:
  386. [pablo@localhost ~]$ su
  387. [root@localhost pablo]# passwd alba
  388. Changing password for user alba.
  389. New password:
  390. BAD PASSWORD: The password is shorter than 8 characters
  391. Retype new password:
  392. passwd: all authentication tokens updated successfully.
  393. [root@localhost pablo]# su - alba
  394. [alba@localhost ~]$ vi empleados.txt
  395. [alba@localhost ~]$ chmod ugo+r,g+w empleados.txt
  396. chmod: cannot access ‘empleados.txt’: No such file or directory
  397. [alba@localhost ~]$ ls
  398. [alba@localhost ~]$ touch empleados.txt
  399. [alba@localhost ~]$ chmod ugo+r,g+w empleados.txt
  400. [alba@localhost ~]$ su - paco
  401. Password:
  402. Last login: Mon May 2 06:51:22 EDT 2016 on pts/0
  403. [paco@localhost ~]$ vi /home/alba/empleados.txt
  404. [paco@localhost ~]$ su
  405. [root@localhost paco]# passwd nerea
  406. Changing password for user nerea.
  407. New password:
  408. BAD PASSWORD: The password is shorter than 8 characters
  409. Retype new password:
  410. passwd: all authentication tokens updated successfully.
  411. [root@localhost paco]# su - nerea
  412. [nerea@localhost ~]$ vi /home/alba/empleados.txt
  413. [nerea@localhost ~]$ su - alba
  414. Password:
  415. Last login: Mon May 2 06:54:15 EDT 2016 on pts/0
  416. [alba@localhost ~]$ chmod g+w empleados.txt
  417. [alba@localhost ~]$ su - nerea
  418. Password:
  419. Last login: Mon May 2 06:59:22 EDT 2016 on pts/0
  420. [nerea@localhost ~]$ sudo /home/alba/empleados.txt
  421.  
  422. We trust you have received the usual lecture from the local System
  423. Administrator. It usually boils down to these three things:
  424.  
  425. #1) Respect the privacy of others.
  426. #2) Think before you type.
  427. #3) With great power comes great responsibility.
  428.  
  429. [sudo] password for nerea:
  430. [nerea@localhost ~]$ vi /home/alba/empleados.txt
  431. [nerea@localhost ~]$ su - alba
  432. Password:
  433. Last login: Mon May 2 07:00:05 EDT 2016 on pts/0
  434. [alba@localhost ~]$ ls -l
  435. total 0
  436. -rw-rw-r--. 1 alba alba 0 May 2 06:58 empleados.txt
  437. [alba@localhost ~]$ chmod g+w empleados.txt
  438. [alba@localhost ~]$ ls -l
  439. total 0
  440. -rw-rw-r--. 1 alba alba 0 May 2 06:58 empleados.txt
  441. [alba@localhost ~]$ chmod o+w empleados.txt
  442. [alba@localhost ~]$ chmod o-w empleados.txt
  443. [alba@localhost ~]$ ls -l
  444. total 0
  445. -rw-rw-r--. 1 alba alba 0 May 2 06:58 empleados.txt
  446. [alba@localhost ~]$ su
  447. [root@localhost alba]# groups oficina2
  448. groups: oficina2: no such user
  449. [root@localhost alba]# groups nerea
  450. nerea : nerea oficina2
  451. [root@localhost alba]# groups alba
  452. alba : alba oficina2
  453. [root@localhost alba]# chmod u=rw,g=r,o=r empleados.txt
  454. [root@localhost alba]# su - nerea
  455. Last login: Mon May 2 07:00:29 EDT 2016 on pts/0
  456. [nerea@localhost ~]$ sudo /home/alba/empleados.txt
  457.  
  458. We trust you have received the usual lecture from the local System
  459. Administrator. It usually boils down to these three things:
  460.  
  461. #1) Respect the privacy of others.
  462. #2) Think before you type.
  463. #3) With great power comes great responsibility.
  464.  
  465. [sudo] password for nerea:
  466. [nerea@localhost ~]$ vi /home/alba/empleados.txt
  467. [nerea@localhost ~]$ su - alba
  468. Password:
  469. Last login: Mon May 2 07:01:05 EDT 2016 on pts/0
  470. [alba@localhost ~]$ ls -l
  471. total 0
  472. -rw-r--r--. 1 alba alba 0 May 2 06:58 empleados.txt
  473. [alba@localhost ~]$ chmod 764 empleados.txt
  474. [alba@localhost ~]$ ls -l
  475. total 0
  476. -rwxrw-r--. 1 alba alba 0 May 2 06:58 empleados.txt
  477. [alba@localhost ~]$ su - nerea
  478. Password:
  479. Last login: Mon May 2 07:06:38 EDT 2016 on pts/0
  480. [nerea@localhost ~]$ vi /home/alba/empleado.txt
  481. [nerea@localhost ~]$ vi /home/alba/empleados.txt
  482. [nerea@localhost ~]$ ls /home/alba
  483. ls: cannot open directory /home/alba: Permission denied
  484. [nerea@localhost ~]$ ^C
  485. [nerea@localhost ~]$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement