/l3/users/16-07-2018/NT-Ladm/debian3.net.nt/root :1 :2 :3 :4 :5 :6 |
|
#ls -all
итого 56 drwx------ 5 root root 4096 Июл 16 10:01 . drwxr-xr-x 24 root root 4096 Окт 15 2014 .. drwx------ 2 root root 4096 Июн 27 2014 .aptitude -rw------- 1 root root 1896 Окт 15 2014 .bash_history -rw-r--r-- 1 root root 10 Июн 27 2014 .bash_profile -rw-r--r-- 1 root root 630 Июн 27 2014 .bashrc -rw-r--r-- 1 root root 5268 Окт 13 2014 install -rw-r--r-- 1 root root 51 Июл 13 14:52 .l3rc drwxr-xr-x 2 root root 4096 Июл 16 10:05 .lilalo -rw-r--r-- 1 root root 140 Ноя 19 2007 .profile drwxr-xr-x 2 root root 4096 Июн 27 2014 .vim -rw------- 1 root root 5398 Июл 16 10:01 .viminfo |
#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=
![]() l3script: ru_RU.UTF-8=: команда не найдена |
#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 --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 |
#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 |
#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.147) ivan pts/2 Jul 16 10:42 (192.168.15.147) petr pts/3 Jul 16 10:45 (192.168.15.147) |
#whoami
root |
#hostname
debian3 |
#echo ~
/root |
#cd /
|
#echo ~
/root |
#cd ..
|
#cd /ivan
![]() l3script: cd: /ivan: No such file or directory |
#cd /root
|
#cd ..
|
#cd /home
|
#cd /ivan
![]() l3script: cd: /ivan: No such file or directory |
#cd ivan
|
#pwd
/home/ivan |
#cd /
|
#cd
|
#cd /home/ivan
|
#cd
|
#ls l
![]() ls: cannot access l: No such file or directory |
#ls -l
total 8 -rw-r--r-- 1 root root 5268 Oct 13 2014 install |
#ls -la
total 56 drwx------ 5 root root 4096 Jul 16 10:01 . drwxr-xr-x 24 root root 4096 Oct 15 2014 .. drwx------ 2 root root 4096 Jun 27 2014 .aptitude -rw------- 1 root root 1896 Oct 15 2014 .bash_history -rw-r--r-- 1 root root 10 Jun 27 2014 .bash_profile -rw-r--r-- 1 root root 630 Jun 27 2014 .bashrc -rw-r--r-- 1 root root 51 Jul 13 14:52 .l3rc drwxr-xr-x 2 root root 4096 Jul 16 10:05 .lilalo -rw-r--r-- 1 root root 140 Nov 19 2007 .profile drwxr-xr-x 2 root root 4096 Jun 27 2014 .vim -rw------- 1 root root 5398 Jul 16 10:01 .viminfo -rw-r--r-- 1 root root 5268 Oct 13 2014 install |
#ls -la --colour
![]() ls: unrecognized option '--colour' Try `ls --help' for more information. |
#ls -la --color
total 56 drwx------ 5 root root 4096 Jul 16 10:01 . drwxr-xr-x 24 root root 4096 Oct 15 2014 .. drwx------ 2 root root 4096 Jun 27 2014 .aptitude -rw------- 1 root root 1896 Oct 15 2014 .bash_history -rw-r--r-- 1 root root 10 Jun 27 2014 .bash_profile -rw-r--r-- 1 root root 630 Jun 27 2014 .bashrc -rw-r--r-- 1 root root 51 Jul 13 14:52 .l3rc drwxr-xr-x 2 root root 4096 Jul 16 10:05 .lilalo -rw-r--r-- 1 root root 140 Nov 19 2007 .profile drwxr-xr-x 2 root root 4096 Jun 27 2014 .vim -rw------- 1 root root 5398 Jul 16 10:01 .viminfo -rw-r--r-- 1 root root 5268 Oct 13 2014 install |
#alias ls='ls --color'
|
#ls -la
total 56 drwx------ 5 root root 4096 Jul 16 10:01 . drwxr-xr-x 24 root root 4096 Oct 15 2014 .. drwx------ 2 root root 4096 Jun 27 2014 .aptitude -rw------- 1 root root 1896 Oct 15 2014 .bash_history -rw-r--r-- 1 root root 10 Jun 27 2014 .bash_profile -rw-r--r-- 1 root root 630 Jun 27 2014 .bashrc -rw-r--r-- 1 root root 51 Jul 13 14:52 .l3rc drwxr-xr-x 2 root root 4096 Jul 16 10:05 .lilalo -rw-r--r-- 1 root root 140 Nov 19 2007 .profile drwxr-xr-x 2 root root 4096 Jun 27 2014 .vim -rw------- 1 root root 5398 Jul 16 10:01 .viminfo -rw-r--r-- 1 root root 5268 Oct 13 2014 install |
#alias
alias ls='ls --color' |
#who
root pts/0 Jul 16 09:55 (192.168.15.147) ivan pts/2 Jul 16 10:42 (192.168.15.147) petr pts/3 Jul 16 10:45 (192.168.15.147) user pts/4 Jul 16 10:51 (192.168.15.147) |
#echo privet>/dev/pts2
|
#echo privet>/dev/pts/2
|
#mailq
|
#witch who
![]() l3script: witch: command not found |
#wich who
![]() l3script: wich: command not found |
#with who
![]() l3script: with: command not found |
#which who
/usr/bin/who |
#ls -l /usr/bin/wh
![]() whatis whereis which whiptail who whoami |
#ls -l /usr/bin/who
-rwxr-xr-x 1 root root 55888 Jan 26 2013 /usr/bin/who |
#which mailq
/usr/bin/mailq |
#ls -l /usr/bin/mailq
lrwxrwxrwx 1 root root 13 Jan 2 2013 /usr/bin/mailq -> ../sbin/exim4 |
#ls -l /usr/sbin/exim
![]() exim exim_checkaccess exim_dbmbuild exim_fixdb exim_tidydb exim4 exim_convert4r4 exim_dumpdb exim_lock eximstats |
#ls -l /usr/sbin/exim4
-rwsr-xr-x 1 root root 973824 Jan 2 2013 /usr/sbin/exim4 |
#ls -l /dev/cdrom1
lrwxrwxrwx 1 root root 3 Jul 16 08:39 /dev/cdrom1 -> sr0 |
#ls -l /dev/sr0
brw-rw---T 1 root cdrom 11, 0 Jul 16 08:39 /dev/sr0 |
#mkfifo /tmp/test
|
#ls -l /tmp/test
prw-r--r-- 1 root root 0 Jul 16 12:03 /tmp/test |
#echo privet > /tmp/test
![]() ^Cl3script: /tmp/test: Interrupted system call |
#ls -l /dev/log
srw-rw-rw- 1 root root 0 Jul 16 08:39 /dev/log |
#netstat
Active Internet connections (w/o servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 debian3.net.nt:ssh 192.168.15.147:49402 ESTABLISHED tcp 0 0 debian3.net.nt:ssh 192.168.15.147:49395 ESTABLISHED tcp 0 368 debian3.net.nt:ssh 192.168.15.147:49316 ESTABLISHED tcp 0 0 debian3.net.nt:ssh 192.168.15.147:49392 ESTABLISHED Active UNIX domain sockets (w/o servers) Proto RefCnt Flags Type State I-Node Path unix 7 [ ] DGRAM 5072 /dev/log unix 3 [ ] STREAM CONNECTED 7191 ... unix 3 [ ] STREAM CONNECTED 6963 unix 3 [ ] STREAM CONNECTED 6962 unix 2 [ ] DGRAM 6961 unix 3 [ ] STREAM CONNECTED 6736 unix 3 [ ] STREAM CONNECTED 6735 unix 2 [ ] DGRAM 6734 unix 2 [ ] DGRAM 5472 unix 2 [ ] DGRAM 5097 unix 3 [ ] DGRAM 3252 unix 3 [ ] DGRAM 3251 |
#echo privet > /tmp/test
dfdsf |
#dfdsf
![]() l3script: dfdsf: command not found |
#cd /home/ivan
|
#cd /home/petr
|
#cd -
/home/ivan |
#cd -
/home/petr |
#echo $allpwd
|
#echo $ALLPWD
|
#echo $OLDPWD
/home/ivan |
#cd ..
|
#cd ..
|
#~
![]() l3script: /root: Is a directory |
#cd /root
|
#apt-get install tree
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: tree 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 43.3 kB of archives. After this operation, 112 kB of additional disk space will be used. Get:1 http://ftp.ua.debian.org/debian/ wheezy/main tree amd64 1.6.0-1 [43.3 kB] Fetched 43.3 kB in 0s (368 kB/s) Selecting previously unselected package tree. (Reading database ... 28835 files and directories currently installed.) Unpacking tree (from .../tree_1.6.0-1_amd64.deb) ... Processing triggers for man-db ... Setting up tree (1.6.0-1) ... |
#cat install
#!/bin/sh hostname=`hostname` uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` ############################################################################### # # Set this variables before installation: lilalo_user=13-10-2014 lab=NT-LNet install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" ... step "Downloading l3prompt" ${wget} ${url_l3prompt} step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}' step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }' step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }' step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users cd / rm -rf ${temp_dir} show_final_message |
#more install
|
#less install
|
#head install
#!/bin/sh hostname=`hostname` uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` ############################################################################### # # Set this variables before installation: lilalo_user=13-10-2014 |
#head -5 install
#!/bin/sh hostname=`hostname` uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` |
#tail install
step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }' step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }' step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users cd / rm -rf ${temp_dir} show_final_message |
#tail install | nl
1 step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }' 2 step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }' 3 step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users 4 step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users 5 step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users 6 cd / 7 rm -rf ${temp_dir} 8 show_final_message |
#tac install
show_final_message rm -rf ${temp_dir} cd / step "Adding l3-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l3bashrc_for_this_users step "Adding l3bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l3bashrc_for_this_users step "Installing l3bashrc to users home directories" install_to_users_homes $install_l3bashrc_for_this_users step "Installing perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make install; cd ..; done; }' step "Downloading perl modules for l3-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }' step "Downloading l3-agent" '${wget} ${url_l3agent}; ${wget} ${url_l3config_pm}; ${wget} ${url_l3config}' step "Downloading l3prompt" ${wget} ${url_l3prompt} ... lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" install_l3bashrc_for_this_users=${users:-"root user"} # users who will use l3agent and l3script lab=NT-LNet lilalo_user=13-10-2014 # Set this variables before installation: # ############################################################################### uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` hostname=`hostname` #!/bin/sh |
#ls -l
total 8 -rw-r--r-- 1 root root 5268 Oct 13 2014 install |
#cp install test
|
#ls
install test |
#which vi
/usr/bin/vi |
#ls -l /usr/bin/vi
lrwxrwxrwx 1 root root 20 Jun 27 2014 /usr/bin/vi -> /etc/alternatives/vi |
#ls -l /etc/al
![]() aliases alternatives/ |
#ls -l /etc/alternatives/vi
lrwxrwxrwx 1 root root 18 Jun 27 2014 /etc/alternatives/vi -> /usr/bin/vim.basic |
#ls -l /usr/bin/vi
![]() vi view vim vim.basic vim.tiny vimdiff vimtutor |
#ls -l /usr/bin/vi
![]() vi view vim vim.basic vim.tiny vimdiff vimtutor |
#ls -l /usr/bin/vim.
![]() vim.basic vim.tiny |
#ls -l /usr/bin/vim.basic
-rwxr-xr-x 1 root root 1876072 Feb 10 2013 /usr/bin/vim.basic |
#which wim
![]() |
#!/bin/sh hostname=`hostname` uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` ############################################################################### # # Set this variables before installation: lilalo_user=13-10-2014 lab=NT-LNet install_l3bashrc_for_this_users=${users:-