/l3/users/16-07-2018/NT-Ladm/debian2.net.nt/root :1 :2 :3 :4 :5 |
|
#useradd ivan
|
#echo $?
0 |
#useradd ivan
![]() useradd: пользователь «ivan» уже существует |
#echo $?
9 |
#useradd --help
ÐÑполÑзование: useradd [паÑамеÑÑÑ] ÐÐÐ seradd -D useradd -D [паÑамеÑÑÑ] ÐаÑамеÑÑÑ: -b, --base-dir ÐÐÐ_ÐÐТ базовÑй каÑалог Ð´Ð»Ñ Ð´Ð¾Ð¼Ð°Ñнего каÑалога новой ÑÑÑÑной запиÑи -c, --comment ÐÐÐÐÐÐТÐÐ ÐРполе GECOS новой ÑÑÑÑной запиÑи -d, --home-dir ÐÐÐ_ÐÐТ домаÑний каÑалог новой ÑÑÑÑной запиÑи -D, --defaults показаÑÑ Ð¸Ð»Ð¸ измениÑÑ Ð½Ð°ÑÑÑойки по ÑмолÑÐ°Ð½Ð¸Ñ Ð´Ð»Ñ useradd ... -p, --password ÐÐÐ ÐÐÑÑной запиÑи -r, --system ÑоздаÑÑ ÑиÑÑемнÑÑ ÑÑÑÑнÑÑ Ð·Ð°Ð¿Ð¸ÑÑ -R, --root ÐÐТ_CHROOT каÑалог, в коÑоÑÑй вÑполнÑеÑÑÑ chroot -s, --shell ÐÐÐРновой ÑÑÑÑной запиÑи -u, --uid UID полÑзоваÑелÑÑкий ID новой ÑÑÑÑной запиÑи -U, --user-group ÑоздаÑÑ Ð³ÑÑÐ¿Ð¿Ñ Ñ Ñем же именем ÑÑо и Ñ Ð¿Ð¾Ð»ÑзоваÑÐµÐ»Ñ -Z, --selinux-user SEUSER иÑполÑзоваÑÑ Ñказанного SEUSER Ð´Ð»Ñ Ð¿Ð¾Ð»ÑзоваÑелÑÑкого ÑопоÑÑÐ°Ð²Ð»ÐµÐ½Ð¸Ñ SELinux |
#LANG=''
|
#useradd --help
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 ... 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 |
#man useradd
|
#passwd ivan
Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully |
#userdel ivan
|
#echo $?
0 |
#useradd -m -s /bin/bash ivan
|
#passwd ivan
Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully |
#useradd -m -s /bin/bash petr
|
#passwd petr
Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully |
#who
root pts/0 Jul 16 09:55 (192.168.15.128) ivan pts/2 Jul 16 10:41 (192.168.15.128) petr pts/3 Jul 16 10:44 (192.168.15.128) |
#cd /
|
#ls
bin boot dev etc home initrd.img lib lib32 lib64 lost+found media mnt opt proc root run sbin selinux srv sys tmp usr var vmlinuz |
#ls -l
total 84 drwxr-xr-x 2 root root 4096 Oct 13 2014 bin drwxr-xr-x 3 root root 4096 Oct 13 2014 boot drwxr-xr-x 12 root root 2960 Jul 16 08:39 dev drwxr-xr-x 68 root root 4096 Jul 16 10:44 etc drwxr-xr-x 5 root root 4096 Jul 16 10:44 home lrwxrwxrwx 1 root root 30 Jun 27 2014 initrd.img -> /boot/initrd.img-3.2.0-4-amd64 drwxr-xr-x 13 root root 4096 Oct 15 2014 lib drwxr-xr-x 2 root root 4096 Oct 15 2014 lib32 drwxr-xr-x 2 root root 4096 Oct 13 2014 lib64 ... drwx------ 5 root root 4096 Jul 16 09:59 root drwxr-xr-x 12 root root 420 Jul 16 08:39 run drwxr-xr-x 2 root root 4096 Oct 13 2014 sbin drwxr-xr-x 2 root root 4096 Jun 10 2012 selinux drwxr-xr-x 2 root root 4096 Jun 27 2014 srv drwxr-xr-x 13 root root 0 Jul 16 08:39 sys drwxrwxrwt 2 root root 4096 Jul 16 10:51 tmp drwxr-xr-x 11 root root 4096 Oct 15 2014 usr drwxr-xr-x 11 root root 4096 Jun 27 2014 var lrwxrwxrwx 1 root root 26 Jun 27 2014 vmlinuz -> boot/vmlinuz-3.2.0-4-amd64 |
#cd ivan
![]() l3script: cd: ivan: No such file or directory |