


cat /etc/passwd посмотреть все пользователей
id andrey инфо пользователя
uid=1000(andrey) gid=1000(andrey) groups=1000(andrey)
[root@cent1 /]# cd /home/andrey
[root@cent1 andrey]# ls -l
total 78668
drwxr-xr-x. 2 root root 183 Mar 21 18:17 ajakava
-rw-r—r— 1 root root 40288256 Mar 23 20:13 arhiv.cpio
-rw-r—r— 1 root root 172 Mar 21 17:32 Dockerfile
drwxr-xr-x 2 root root 6 Mar 23 20:15 extract
drwxr-xr-x 2 root root 6 Mar 24 18:50 folder1
drwxr-xr-x 3 root root 21 Mar 23 19:42 folder2
-rw-rw-r—. 1 andrey andrey 40263680 Mar 20 15:08 kubectl
drwxr-xr-x 2 root root 235 Mar 21 17:18 test
[root@cent1 andrey]# chown andrey arhiv.cpio меняем владельца файла
[root@cent1 andrey]# ls -l
total 78668
drwxr-xr-x. 2 root root 183 Mar 21 18:17 ajakava
-rw-r—r— 1 andrey root 40288256 Mar 23 20:13 arhiv.cpio
-rw-r—r— 1 root root 172 Mar 21 17:32 Dockerfile
drwxr-xr-x 2 root root 6 Mar 23 20:15 extract
drwxr-xr-x 2 root root 6 Mar 24 18:50 folder1
drwxr-xr-x 3 root root 21 Mar 23 19:42 folder2
-rw-rw-r—. 1 andrey andrey 40263680 Mar 20 15:08 kubectl
drwxr-xr-x 2 root root 235 Mar 21 17:18 test
[root@cent1 andrey]# chgrp andrey arhiv.cpio меняем группу
[root@cent1 andrey]# ls -l
total 78668
drwxr-xr-x. 2 root root 183 Mar 21 18:17 ajakava
-rw-r—r— 1 andrey andrey 40288256 Mar 23 20:13 arhiv.cpio
-rw-r—r— 1 root root 172 Mar 21 17:32 Dockerfile
drwxr-xr-x 2 root root 6 Mar 23 20:15 extract
drwxr-xr-x 2 root root 6 Mar 24 18:50 folder1
drwxr-xr-x 3 root root 21 Mar 23 19:42 folder2
-rw-rw-r—. 1 andrey andrey 40263680 Mar 20 15:08 kubectl
drwxr-xr-x 2 root root 235 Mar 21 17:18 test
или группу можно поменять так
chown :andrey Dockerfile
[root@cent1 andrey]# ls -l
total 78668
drwxr-xr-x. 2 root root 183 Mar 21 18:17 ajakava
-rw-r—r— 1 andrey andrey 40288256 Mar 23 20:13 arhiv.cpio
-rw-r—r— 1 root andrey 172 Mar 21 17:32 Dockerfile
drwxr-xr-x 2 root root 6 Mar 23 20:15 extract
drwxr-xr-x 2 root root 6 Mar 24 18:50 folder1
drwxr-xr-x 3 root root 21 Mar 23 19:42 folder2
-rw-rw-r—. 1 andrey andrey 40263680 Mar 20 15:08 kubectl
drwxr-xr-x 2 root root 235 Mar 21 17:18 test
или владельца и группу сразу
chown andrey:andrey ajakava
[root@cent1 andrey]# ls -l
total 78668
drwxr-xr-x. 2 andrey andrey 183 Mar 21 18:17 ajakava
-rw-r—r— 1 andrey andrey 40288256 Mar 23 20:13 arhiv.cpio
-rw-r—r— 1 root andrey 172 Mar 21 17:32 Dockerfile
drwxr-xr-x 2 root root 6 Mar 23 20:15 extract
drwxr-xr-x 2 root root 6 Mar 24 18:50 folder1
drwxr-xr-x 3 root root 21 Mar 23 19:42 folder2
-rw-rw-r—. 1 andrey andrey 40263680 Mar 20 15:08 kubectl
drwxr-xr-x 2 root root 235 Mar 21 17:18 test
chown -R andrey folder1 меняем владельца и на вложенные папки тоже
