/l3/users/28-09-2015/NT-Ladm/debian3.net.nt/root :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 |
|
#cat install | egrep 'ht{2,5}p'
url_lilalo="http://xgu.ru/lilalo" http://xgu.ru/l3/${lilalo_context} For further information see http://xgu.ru/lilalo/ (in Russian). |
#cat install | egrep 'h(tt)?p'
url_lilalo="http://xgu.ru/lilalo" http://xgu.ru/l3/${lilalo_context} For further information see http://xgu.ru/lilalo/ (in Russian). |
#cat install | egrep '(cat)?'
#!/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 |
#cat install | egrep '(cat)'
cat log | sed 's/^/|\ \ \ /' cat log | sed 's/^/|\ \ \ /' || { echo >> ${user_home}/.bash_profile ; cat ${user_home}/.bash_profile | sed '1s/^/l3-agentX/' | tr X '\n' > /tmp/$$$$l3 ; mv /tmp/$$$$l3 ${user_home}/.bash_profile; chown -R ${user} ${user_home}/.bash_profile; } cat <<USAGE cat <<FINAL_MESSAGE 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 |
#cat install | egrep '(cat)+'
cat log | sed 's/^/|\ \ \ /' cat log | sed 's/^/|\ \ \ /' || { echo >> ${user_home}/.bash_profile ; cat ${user_home}/.bash_profile | sed '1s/^/l3-agentX/' | tr X '\n' > /tmp/$$$$l3 ; mv /tmp/$$$$l3 ${user_home}/.bash_profile; chown -R ${user} ${user_home}/.bash_profile; } cat <<USAGE cat <<FINAL_MESSAGE 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 |
#cat install | egrep '(cat){2}'
![]() |
#cat install | egrep '(cat){3}'
![]() |
#cat install | egrep '(cat){2}'
![]() |
#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 |
#cat install | egrep 'if (which )? apt-get'
![]() |
#cat install | egrep 'if (which )?apt-get'
if which apt-get >& /dev/null |
#cat install | egrep 'if (which )?apt-get'
if which apt-get >& /dev/null |
#cat install | egrep 'if (which |locate )?apt-get'
if which apt-get >& /dev/null |
#ps lax
F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND 4 0 1 0 20 0 10648 832 - Ss ? 0:05 init [2] 1 0 2 0 20 0 0 0 - S ? 0:00 [kthreadd] 1 0 3 2 20 0 0 0 - S ? 0:00 [ksoftirqd/0] 1 0 5 2 20 0 0 0 - S ? 0:00 [kworker/u:0] 1 0 6 2 -100 - 0 0 - S ? 0:00 [migration/0] 5 0 7 2 -100 - 0 0 - S ? 0:03 [watchdog/0] 1 0 8 2 0 -20 0 0 - S< ? 0:00 [cpuset] 1 0 9 2 0 -20 0 0 - S< ? 0:00 [khelper] 5 0 10 2 20 0 0 0 - S ? 0:00 [kdevtmpfs] ... 0 1002 8988 8987 20 0 22600 3196 - Ss+ pts/5 0:00 -bash 0 0 9855 8699 20 0 34252 3448 - T pts/1 0:00 /usr/bin/vi privet.sh 0 0 9903 8699 20 0 34264 3536 - T pts/1 0:00 /usr/bin/vi privet.sh 0 0 10104 8699 20 0 9960 936 - T pts/1 0:00 more 0 0 10325 8699 20 0 7728 320 - T pts/1 0:00 cat 0 1001 10506 8904 20 0 36712 2092 - T pts/4 0:00 mail 1 0 11501 2 20 0 0 0 - S ? 0:00 [kworker/0:1] 0 1000 12176 8840 20 0 7728 320 - T pts/3 0:00 cat 0 0 12837 8699 20 0 10420 1656 - T pts/1 0:03 egrep -R (([0-9]|[0-9]{2 4 0 12853 8699 20 0 10536 844 - R+ pts/1 0:00 ps lax |
#avk
![]() l3script: avk: команда не найдена |
#av
l3script: av: команда не найдена |
#ps lax | awk '$11!~/\?/'
F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND 4 0 2306 1 20 0 18368 964 - Ss+ tty1 0:00 /sbin/getty 38400 tty1 4 0 2307 1 20 0 18368 972 - Ss+ tty2 0:00 /sbin/getty 38400 tty2 4 0 2308 1 20 0 18368 964 - Ss+ tty3 0:00 /sbin/getty 38400 tty3 4 0 2309 1 20 0 18368 968 - Ss+ tty4 0:00 /sbin/getty 38400 tty4 4 0 2310 1 20 0 18368 972 - Ss+ tty5 0:00 /sbin/getty 38400 tty5 4 0 2311 1 20 0 18368 972 - Ss+ tty6 0:00 /sbin/getty 38400 tty6 4 0 8622 8620 20 0 22100 2768 - Ss pts/0 0:00 -bash 0 0 8667 8622 20 0 18164 844 - S+ pts/0 0:00 script -f -c l3script -q /root/.lilalo//27826459228625774-1443508639.script 1 0 8698 8667 20 0 18168 472 - S+ pts/0 0:00 script -f -c l3script -q /root/.lilalo//27826459228625774-1443508639.script ... 0 1002 8988 8987 20 0 22600 3196 - Ss+ pts/5 0:00 -bash 0 0 9855 8699 20 0 34252 3448 - T pts/1 0:00 /usr/bin/vi privet.sh 0 0 9903 8699 20 0 34264 3536 - T pts/1 0:00 /usr/bin/vi privet.sh 0 0 10104 8699 20 0 9960 936 - T pts/1 0:00 more 0 0 10325 8699 20 0 7728 320 - T pts/1 0:00 cat 0 1001 10506 8904 20 0 36712 2092 - T pts/4 0:00 mail 0 1000 12176 8840 20 0 7728 320 - T pts/3 0:00 cat 0 0 12837 8699 20 0 10420 1656 - T pts/1 0:03 egrep -R (([0-9]|[0-9]{2}|1[0-9]{2}|2[0-9]{3}])\.){3}([0-9]|[0-9]{2}|1[0-9]{2}|2[0-9]{3}) /etc 4 0 12902 8699 20 0 10536 844 - R+ pts/1 0:00 ps lax 0 0 12903 8699 20 0 6764 604 - S+ pts/1 0:00 awk $11!~/\?/ |
#ps lax | awk '$12~/00/'
1 0 2 0 20 0 0 0 - S ? 0:00 [kthreadd] 1 0 3 2 20 0 0 0 - S ? 0:00 [ksoftirqd/0] 1 0 5 2 20 0 0 0 - S ? 0:00 [kworker/u:0] 1 0 6 2 -100 - 0 0 - S ? 0:00 [migration/0] 1 0 8 2 0 -20 0 0 - S< ? 0:00 [cpuset] 1 0 9 2 0 -20 0 0 - S< ? 0:00 [khelper] 5 0 10 2 20 0 0 0 - S ? 0:00 [kdevtmpfs] 1 0 11 2 0 -20 0 0 - S< ? 0:00 [netns] 1 0 12 2 20 0 0 0 - S ? 0:00 [xenwatch] 1 0 13 2 20 0 0 0 - S ? 0:00 [xenbus] ... 0 1002 8988 8987 20 0 22600 3196 - Ss+ pts/5 0:00 -bash 0 0 9855 8699 20 0 34252 3448 - T pts/1 0:00 /usr/bin/vi privet.sh 0 0 9903 8699 20 0 34264 3536 - T pts/1 0:00 /usr/bin/vi privet.sh 0 0 10104 8699 20 0 9960 936 - T pts/1 0:00 more 0 0 10325 8699 20 0 7728 320 - T pts/1 0:00 cat 0 1001 10506 8904 20 0 36712 2092 - T pts/4 0:00 mail 1 0 11501 2 20 0 0 0 - S ? 0:00 [kworker/0:1] 0 1000 12176 8840 20 0 7728 320 - T pts/3 0:00 cat 4 0 12911 8699 20 0 10536 848 - R+ pts/1 0:00 ps lax 0 0 12912 8699 20 0 6764 604 - S+ pts/1 0:00 awk $12~/00/ |
#ps lax | awk '$12~/0{0}/'
|
#cat /etc/passwd
root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/bin/sh bin:x:2:2:bin:/bin:/bin/sh sys:x:3:3:sys:/dev:/bin/sh sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/bin/sh man:x:6:12:man:/var/cache/man:/bin/sh lp:x:7:7:lp:/var/spool/lpd:/bin/sh mail:x:8:8:mail:/var/mail:/bin/sh news:x:9:9:news:/var/spool/news:/bin/sh ... list:x:38:38:Mailing List Manager:/var/list:/bin/sh irc:x:39:39:ircd:/var/run/ircd:/bin/sh gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh nobody:x:65534:65534:nobody:/nonexistent:/bin/sh libuuid:x:100:101::/var/lib/libuuid:/bin/sh Debian-exim:x:101:103::/var/spool/exim4:/bin/false user:x:1000:1000:user,,,:/home/user:/bin/bash sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin ivan:x:1001:1001::/home/ivan:/bin/bash petr:x:1002:1002::/home/petr:/bin/bash |
#ls
all errors install privet.sh report shadow |
#vi shell.sh
![]() --- /dev/null 2015-09-25 17:22:51.904000007 +0300 +++ shell.sh 2015-09-29 14:56:42.954484101 +0300 @@ -0,0 +1,4 @@ +#!/bin/bash + +uid=$(grep '^UID_MIN' /etc/login.defs | awk '{print 2$}') + |
#shell.sh
![]() l3script: shell.sh: команда не найдена |
#./shell.sh
![]() l3script: ./shell.sh: Отказано в доступе |
#shell.sh
![]() l3script: shell.sh: команда не найдена |
#vi shell.sh
![]() |
#vi shell.sh
![]() --- /tmp/l3-saved-8699.12124.453 2015-09-29 14:58:08.694496510 +0300 +++ shell.sh 2015-09-29 14:58:59.154481874 +0300 @@ -1,4 +1,4 @@ #!/bin/bash -uid=$(grep '^UID_MIN' /etc/login.defs | awk '{print 2$}') +uid=$(grep '^UID_MIN' /etc/login.defs | awk '{print $2}') |
#vi shell.sh
![]() --- /tmp/l3-saved-8699.12323.25098 2015-09-29 14:59:00.970496534 +0300 +++ shell.sh 2015-09-29 15:02:17.734495258 +0300 @@ -2,3 +2,6 @@ uid=$(grep '^UID_MIN' /etc/login.defs | awk '{print $2}') +users=$(awk -F: '$3>=$uid{print $1} ) + + |
#uid=$(grep '^UID_MIN' /etc/login.defs | awk '{print $2}')
|
#echo uid
uid |
#(awk -F: '$3>=$uid{print $1}
![]() |
#vi shell.sh
![]() |
#vi shell.sh
![]() --- /tmp/l3-saved-8699.2306.30008 2015-09-29 15:04:09.946501019 +0300 +++ shell.sh 2015-09-29 15:10:58.982493314 +0300 @@ -2,6 +2,9 @@ uid=$(grep '^UID_MIN' /etc/login.defs | awk '{print $2}') -users=$(awk -F: '$3>=$uid{print $1} ) - +users=$(awk -F: '$3>=1000 && $3!=65534 {print $1}' /etc/passwd) +for user in $users + do + usermod -s $1 $user + done |
#shell.sh
![]() l3script: shell.sh: команда не найдена |
#bash shell.sh
![]() ÐÑполÑзование: usermod [паÑамеÑÑÑ] ÐÐÐ , --comment ÐÐÐÐÐÐТÐÐ ÐРновое знаÑение Ð¿Ð¾Ð»Ñ GECOS -d, --home ÐÐÐ_ÐÐТ новÑй домаÑний каÑалог ÑÑÑÑной запиÑи -e, --expiredate ÐÐТÐ_УСТ ÑÑÑановиÑÑ Ð´Ð°ÑÑ Ð¾ÐºÐ¾Ð½ÑÐ°Ð½Ð¸Ñ Ð´ÐµÐ¹ÑÑÐ²Ð¸Ñ ÑÑÑÑной запиÑи в ÐÐТÐ_УСТ -f, --inactive ÐÐÐÐТÐÐÐÐСТЬ ÑÑÑановиÑÑ Ð¿ÐµÑиод неакÑивноÑÑи паÑÐ¾Ð»Ñ Ð¿Ð¾Ñле ÑÑÑаÑÐµÐ²Ð°Ð½Ð¸Ñ ÑÑÑÑной запиÑи ÑавнÑм ÐÐÐÐТÐÐÐÐСТЬ -g, --gid ÐРУÐÐРпÑинÑдиÑелÑно назнаÑиÑÑ Ð¿ÐµÑвиÑнÑÑ ÐРУÐÐУ -G, --groups ÐРУÐÐЫ ÑпиÑок дополниÑелÑнÑÑ ÐРУÐÐ -a, --append добавиÑÑ Ð¿Ð¾Ð»ÑзоваÑÐµÐ»Ñ Ð² дополниÑелÑнÑе ... имеÑÑимÑÑ (не ÑникалÑнÑм) UID -p, --password ÐÐÐ ÐÐ¾Ð»Ñ Ð´Ð»Ñ ÑÑÑÑной запиÑи -R, --root ÐÐТ_CHROOT каÑалог, в коÑоÑÑй вÑполнÑеÑÑÑ chroot -s, --shell ÐÐÐолоÑка Ð´Ð»Ñ ÑÑÑÑной запиÑи -u, --uid UID новÑй UID Ð´Ð»Ñ ÑÑÑÑной запиÑи -U, --unlock ÑазблокиÑоваÑÑ ÑÑÑÑнÑÑ Ð·Ð°Ð¿Ð¸ÑÑ -Z, --selinux-user SEUSER новое полÑзоваÑелÑÑкое ÑопоÑÑавление SELinux Ð´Ð»Ñ ÑÑÑÑной запиÑи |
#shell.sh
![]() l3script: shell.sh: команда не найдена |
#./ shell.sh
![]() l3script: ./: Это каталог |
#./shell.sh
![]() l3script: ./shell.sh: Отказано в доступе |
#vi shell.sh
![]() --- /tmp/l3-saved-8699.27365.28266 2015-09-29 15:11:29.830497732 +0300 +++ shell.sh 2015-09-29 15:16:34.426496514 +0300 @@ -3,8 +3,9 @@ uid=$(grep '^UID_MIN' /etc/login.defs | awk '{print $2}') users=$(awk -F: '$3>=1000 && $3!=65534 {print $1}' /etc/passwd) + for user in $users do - usermod -s $1 $user + grep "^$user.*bash" /etc/passwd &> /dev/null || usermod -s $1 $user done |
#shell.sh
![]() l3script: shell.sh: команда не найдена |
#./shell.sh
![]() l3script: ./shell.sh: Отказано в доступе |
#bash shell.sh
|
#vi shell.sh
![]() |
#~
![]() 4 sys:x:3:3:sys:/dev:/bin/sh 5 sync:x:4:65534:sync:/bin:/bin/sync 6 games:x:5:60:games:/usr/games:/bin/sh 7 man:x:6:12:man:/var/cache/man:/bin/sh 8 lp:x:7:7:lp:/var/spool/lpd:/bin/sh 9 mail:x:8:8:mail:/var/mail:/bin/sh 10 news:x:9:9:news:/var/spool/news:/bin/sh 11 uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh 12 proxy:x:13:13:proxy:/bin:/bin/sh 13 www-data:x:33:33:www-data:/var/www:/bin/sh ... ~ ~ ~ ~ ~ ~ ~ ~ ~ "/etc/passwd" 24L, 984C записано |
#bash shell.sh
![]() ÐÑполÑзование: usermod [паÑамеÑÑÑ] ÐÐÐ , --comment ÐÐÐÐÐÐТÐÐ ÐРновое знаÑение Ð¿Ð¾Ð»Ñ GECOS -d, --home ÐÐÐ_ÐÐТ новÑй домаÑний каÑалог ÑÑÑÑной запиÑи -e, --expiredate ÐÐТÐ_УСТ ÑÑÑановиÑÑ Ð´Ð°ÑÑ Ð¾ÐºÐ¾Ð½ÑÐ°Ð½Ð¸Ñ Ð´ÐµÐ¹ÑÑÐ²Ð¸Ñ ÑÑÑÑной запиÑи в ÐÐТÐ_УСТ -f, --inactive ÐÐÐÐТÐÐÐÐСТЬ ÑÑÑановиÑÑ Ð¿ÐµÑиод неакÑивноÑÑи паÑÐ¾Ð»Ñ Ð¿Ð¾Ñле ÑÑÑаÑÐµÐ²Ð°Ð½Ð¸Ñ ÑÑÑÑной запиÑи ÑавнÑм ÐÐÐÐТÐÐÐÐСТЬ -g, --gid ÐРУÐÐРпÑинÑдиÑелÑно назнаÑиÑÑ Ð¿ÐµÑвиÑнÑÑ ÐРУÐÐУ -G, --groups ÐРУÐÐЫ ÑпиÑок дополниÑелÑнÑÑ ÐРУÐÐ -a, --append добавиÑÑ Ð¿Ð¾Ð»ÑзоваÑÐµÐ»Ñ Ð² дополниÑелÑнÑе ... имеÑÑимÑÑ (не ÑникалÑнÑм) UID -p, --password ÐÐÐ ÐÐ¾Ð»Ñ Ð´Ð»Ñ ÑÑÑÑной запиÑи -R, --root ÐÐТ_CHROOT каÑалог, в коÑоÑÑй вÑполнÑеÑÑÑ chroot -s, --shell ÐÐÐолоÑка Ð´Ð»Ñ ÑÑÑÑной запиÑи -u, --uid UID новÑй UID Ð´Ð»Ñ ÑÑÑÑной запиÑи -U, --unlock ÑазблокиÑоваÑÑ ÑÑÑÑнÑÑ Ð·Ð°Ð¿Ð¸ÑÑ -Z, --selinux-user SEUSER новое полÑзоваÑелÑÑкое ÑопоÑÑавление SELinux Ð´Ð»Ñ ÑÑÑÑной запиÑи |
#bash shell.sh
![]() ÐÑполÑзование: usermod [паÑамеÑÑÑ] ÐÐÐ , --comment ÐÐÐÐÐÐТÐÐ ÐРновое знаÑение Ð¿Ð¾Ð»Ñ GECOS -d, --home ÐÐÐ_ÐÐТ новÑй домаÑний каÑалог ÑÑÑÑной запиÑи -e, --expiredate ÐÐТÐ_УСТ ÑÑÑановиÑÑ Ð´Ð°ÑÑ Ð¾ÐºÐ¾Ð½ÑÐ°Ð½Ð¸Ñ Ð´ÐµÐ¹ÑÑÐ²Ð¸Ñ ÑÑÑÑной запиÑи в ÐÐТÐ_УСТ -f, --inactive ÐÐÐÐТÐÐÐÐСТЬ ÑÑÑановиÑÑ Ð¿ÐµÑиод неакÑивноÑÑи паÑÐ¾Ð»Ñ Ð¿Ð¾Ñле ÑÑÑаÑÐµÐ²Ð°Ð½Ð¸Ñ ÑÑÑÑной запиÑи ÑавнÑм ÐÐÐÐТÐÐÐÐСТЬ -g, --gid ÐРУÐÐРпÑинÑдиÑелÑно назнаÑиÑÑ Ð¿ÐµÑвиÑнÑÑ ÐРУÐÐУ -G, --groups ÐРУÐÐЫ ÑпиÑок дополниÑелÑнÑÑ ÐРУÐÐ -a, --append добавиÑÑ Ð¿Ð¾Ð»ÑзоваÑÐµÐ»Ñ Ð² дополниÑелÑнÑе ... имеÑÑимÑÑ (не ÑникалÑнÑм) UID -p, --password ÐÐÐ ÐÐ¾Ð»Ñ Ð´Ð»Ñ ÑÑÑÑной запиÑи -R, --root ÐÐТ_CHROOT каÑалог, в коÑоÑÑй вÑполнÑеÑÑÑ chroot -s, --shell ÐÐÐолоÑка Ð´Ð»Ñ ÑÑÑÑной запиÑи -u, --uid UID новÑй UID Ð´Ð»Ñ ÑÑÑÑной запиÑи -U, --unlock ÑазблокиÑоваÑÑ ÑÑÑÑнÑÑ Ð·Ð°Ð¿Ð¸ÑÑ -Z, --selinux-user SEUSER новое полÑзоваÑелÑÑкое ÑопоÑÑавление SELinux Ð´Ð»Ñ ÑÑÑÑной запиÑи |
#vi shell.sh
![]() |
#~
![]() ÐÑполÑзование: usermod [паÑамеÑÑÑ] ÐÐÐ , --comment ÐÐÐÐÐÐТÐÐ ÐРновое знаÑение Ð¿Ð¾Ð»Ñ GECOS -d, --home ÐÐÐ_ÐÐТ новÑй домаÑний каÑалог ÑÑÑÑной запиÑи -e, --expiredate ÐÐТÐ_УСТ ÑÑÑановиÑÑ Ð´Ð°ÑÑ Ð¾ÐºÐ¾Ð½ÑÐ°Ð½Ð¸Ñ Ð´ÐµÐ¹ÑÑÐ²Ð¸Ñ ÑÑÑÑной запиÑи в ÐÐТÐ_УСТ -f, --inactive ÐÐÐÐТÐÐÐÐСТЬ ÑÑÑановиÑÑ Ð¿ÐµÑиод неакÑивноÑÑи паÑÐ¾Ð»Ñ Ð¿Ð¾Ñле ÑÑÑаÑÐµÐ²Ð°Ð½Ð¸Ñ ÑÑÑÑной запиÑи ÑавнÑм ÐÐÐÐТÐÐÐÐСТЬ -g, --gid ÐРУÐÐРпÑинÑдиÑелÑно назнаÑиÑÑ Ð¿ÐµÑвиÑнÑÑ ÐРУÐÐУ -G, --groups ÐРУÐÐЫ ÑпиÑок дополниÑелÑнÑÑ ÐРУÐÐ -a, --append добавиÑÑ Ð¿Ð¾Ð»ÑзоваÑÐµÐ»Ñ Ð² дополниÑелÑнÑе ... имеÑÑимÑÑ (не ÑникалÑнÑм) UID -p, --password ÐÐÐ ÐÐ¾Ð»Ñ Ð´Ð»Ñ ÑÑÑÑной запиÑи -R, --root ÐÐТ_CHROOT каÑалог, в коÑоÑÑй вÑполнÑеÑÑÑ chroot -s, --shell ÐÐÐолоÑка Ð´Ð»Ñ ÑÑÑÑной запиÑи -u, --uid UID новÑй UID Ð´Ð»Ñ ÑÑÑÑной запиÑи -U, --unlock ÑазблокиÑоваÑÑ ÑÑÑÑнÑÑ Ð·Ð°Ð¿Ð¸ÑÑ -Z, --selinux-user SEUSER новое полÑзоваÑелÑÑкое ÑопоÑÑавление SELinux Ð´Ð»Ñ ÑÑÑÑной запиÑи |
#vi /etc/passwd
![]() |
#~
![]() 1 #!/bin/bash 2 3 uid=$(grep '^UID_MIN' /etc/login.defs | awk '{print $2}') 4 5 users=$(awk -F: '$3>=1000 && $3!=65534 {print $1}' /etc/passwd) 6 7 for user in $users 8 do 9 grep "^$user.*bash" /etc/passwd &> /dev/null || usermod -s $1 $user 10 done 11 "shell.sh" 11L, 236C |
#~
![]() ÐÑполÑзование: usermod [паÑамеÑÑÑ] ÐÐÐ , --comment ÐÐÐÐÐÐТÐÐ ÐРновое знаÑение Ð¿Ð¾Ð»Ñ GECOS -d, --home ÐÐÐ_ÐÐТ новÑй домаÑний каÑалог ÑÑÑÑной запиÑи -e, --expiredate ÐÐТÐ_УСТ ÑÑÑановиÑÑ Ð´Ð°ÑÑ Ð¾ÐºÐ¾Ð½ÑÐ°Ð½Ð¸Ñ Ð´ÐµÐ¹ÑÑÐ²Ð¸Ñ ÑÑÑÑной запиÑи в ÐÐТÐ_УСТ -f, --inactive ÐÐÐÐТÐÐÐÐСТЬ ÑÑÑановиÑÑ Ð¿ÐµÑиод неакÑивноÑÑи паÑÐ¾Ð»Ñ Ð¿Ð¾Ñле ÑÑÑаÑÐµÐ²Ð°Ð½Ð¸Ñ ÑÑÑÑной запиÑи ÑавнÑм ÐÐÐÐТÐÐÐÐСТЬ -g, --gid ÐРУÐÐРпÑинÑдиÑелÑно назнаÑиÑÑ Ð¿ÐµÑвиÑнÑÑ ÐРУÐÐУ -G, --groups ÐРУÐÐЫ ÑпиÑок дополниÑелÑнÑÑ ÐРУÐÐ -a, --append добавиÑÑ Ð¿Ð¾Ð»ÑзоваÑÐµÐ»Ñ Ð² дополниÑелÑнÑе ... имеÑÑимÑÑ (не ÑникалÑнÑм) UID -p, --password ÐÐÐ ÐÐ¾Ð»Ñ Ð´Ð»Ñ ÑÑÑÑной запиÑи -R, --root ÐÐТ_CHROOT каÑалог, в коÑоÑÑй вÑполнÑеÑÑÑ chroot -s, --shell ÐÐÐолоÑка Ð´Ð»Ñ ÑÑÑÑной запиÑи -u, --uid UID новÑй UID Ð´Ð»Ñ ÑÑÑÑной запиÑи -U, --unlock ÑазблокиÑоваÑÑ ÑÑÑÑнÑÑ Ð·Ð°Ð¿Ð¸ÑÑ -Z, --selinux-user SEUSER новое полÑзоваÑелÑÑкое ÑопоÑÑавление SELinux Ð´Ð»Ñ ÑÑÑÑной запиÑи |
#vi /etc/passwd
![]() |
#vi shell.sh /bin/bash
![]() |
#bash shell.sh /bin/bash
|
#ch
![]() chage chattr checkint chgpasswd chkdupexe chown chroot chsh chardet chcon chfn chgrp chmod chpasswd chrt chvt |
#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 |
#cat install | sed '1,10p'
#!/bin/sh #!/bin/sh hostname=`hostname` hostname=`hostname` uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` ############################################################################### ############################################################################### # # ... 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 |
#cat install | sed -n '1,10p'
#!/bin/sh hostname=`hostname` uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` ############################################################################### # # Set this variables before installation: lilalo_user=13-10-2014 |
#cat install | sed '1,10p'
#!/bin/sh #!/bin/sh hostname=`hostname` hostname=`hostname` uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` ############################################################################### ############################################################################### # # ... 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 |
#cat install | sed -n '1,10p'
#!/bin/sh hostname=`hostname` uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` ############################################################################### # # Set this variables before installation: lilalo_user=13-10-2014 |
#cat install | sed -n '/^$/p'
|
#cat install | sed '/^$/p'
#!/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 |
#cat install | sed '/^$/p'
#!/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 |
#cat install | sed 's/step/STEP/'
#!/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 |
#cat install | sed 's/STEP/step/'
#!/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 |
#cat install | sed '1,10/s/STEP/step/'
![]() sed: -e выражение #1, символ 5: неизвестная команда: `/' |
#cat install | sed '1,10s/STEP/step/'
#!/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 |
#cat install | sed '1,100s/STEP/step/'
#!/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 |
#cat install | sed '157,$s/step/STEP/'
#!/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 |
#cat install | tr 3 4
#!/bin/sh hostname=`hostname` uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` ############################################################################### # # Set this variables before installation: lilalo_user=14-10-2014 lab=NT-LNet install_l4bashrc_for_this_users=${users:-"root user"} # users who will use l4agent and l4script lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" ... step "Downloading l4prompt" ${wget} ${url_l4prompt} step "Downloading l4-agent" '${wget} ${url_l4agent}; ${wget} ${url_l4config_pm}; ${wget} ${url_l4config}' step "Downloading perl modules for l4-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }' step "Installing perl modules for l4-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 l4bashrc to users home directories" install_to_users_homes $install_l4bashrc_for_this_users step "Adding l4bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l4bashrc_for_this_users step "Adding l4-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l4bashrc_for_this_users cd / rm -rf ${temp_dir} show_final_message |
#cat install | tr 123 456
#!/bin/sh hostname=`hostname` uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` ############################################################################### # # Set this variables before installation: lilalo_user=46-40-5044 lab=NT-LNet install_l6bashrc_for_this_users=${users:-"root user"} # users who will use l6agent and l6script lilalo_context="/users/${lilalo_user}/${lab}/${hostname}" ... step "Downloading l6prompt" ${wget} ${url_l6prompt} step "Downloading l6-agent" '${wget} ${url_l6agent}; ${wget} ${url_l6config_pm}; ${wget} ${url_l6config}' step "Downloading perl modules for l6-agent" '{ for i in ${perl_modules}; do ${wget} ${url_perl_modules}/$i.tar.gz; done; }' step "Installing perl modules for l6-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 l6bashrc to users home directories" install_to_users_homes $install_l6bashrc_for_this_users step "Adding l6bashrc invocation to ~/.bashrc " install_to_users_bashrc $install_l6bashrc_for_this_users step "Adding l6-agent invocation to ~/.bash_profile " install_to_users_bash_profile $install_l6bashrc_for_this_users cd / rm -rf ${temp_dir} show_final_message |
#cat install | tr -s l
#!/bin/sh hostname=`hostname` uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` ############################################################################### # # Set this variables before instalation: lilalo_user=13-10-2014 lab=NT-LNet instal_l3bashrc_for_this_users=${users:-"root user"} # users who wil 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 "Instaling perl modules for l3-agent" '{ for i in ${perl_modules}; do tar xvfz $i.tar.gz; cd $i*[^z]; perl Makefile.PL; make; make instal; cd ..; done; }' step "Instaling l3bashrc to users home directories" instal_to_users_homes $instal_l3bashrc_for_this_users step "Adding l3bashrc invocation to ~/.bashrc " instal_to_users_bashrc $instal_l3bashrc_for_this_users step "Adding l3-agent invocation to ~/.bash_profile " instal_to_users_bash_profile $instal_l3bashrc_for_this_users cd / rm -rf ${temp_dir} show_final_message |
#cat install | tr -s \n
#!/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 |
#cat install | tr -s "\n"
#!/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 |
#cat install | tr -d l
#!/bin/sh hostname=`hostname` uname -a | egrep -qi '(freebsd|darwin)' || hostname=`hostname -f` ############################################################################### # # Set this variabes before instaation: iao_user=13-10-2014 ab=NT-LNet insta_3bashrc_for_this_users=${users:-"root user"} # users who wi use 3agent and 3script iao_context="/users/${iao_user}/${ab}/${hostname}" ... step "Downoading 3prompt" ${wget} ${ur_3prompt} step "Downoading 3-agent" '${wget} ${ur_3agent}; ${wget} ${ur_3config_pm}; ${wget} ${ur_3config}' step "Downoading per modues for 3-agent" '{ for i in ${per_modues}; do ${wget} ${ur_per_modues}/$i.tar.gz; done; }' step "Instaing per modues for 3-agent" '{ for i in ${per_modues}; do tar xvfz $i.tar.gz; cd $i*[^z]; per Makefie.PL; make; make insta; cd ..; done; }' step "Instaing 3bashrc to users home directories" insta_to_users_homes $insta_3bashrc_for_this_users step "Adding 3bashrc invocation to ~/.bashrc " insta_to_users_bashrc $insta_3bashrc_for_this_users step "Adding 3-agent invocation to ~/.bash_profie " insta_to_users_bash_profie $insta_3bashrc_for_this_users cd / rm -rf ${temp_dir} show_fina_message |
#cat install | tr -d [:punct:]
binsh hostnamehostname uname a egrep qi freebsddarwin hostnamehostname f Set this variables before installation lilalouser13102014 labNTLNet installl3bashrcforthisusersusersroot user users who will use l3agent and l3script lilalocontextuserslilalouserlabhostname lilalorcl3rc lilalohomelilalo ... step Downloading l3prompt wget urll3prompt step Downloading l3agent wget urll3agent wget urll3configpm wget urll3config step Downloading perl modules for l3agent for i in perlmodules do wget urlperlmodulesitargz done step Installing perl modules for l3agent for i in perlmodules do tar xvfz itargz cd iz perl MakefilePL make make install cd done step Installing l3bashrc to users home directories installtousershomes installl3bashrcforthisusers step Adding l3bashrc invocation to bashrc installtousersbashrc installl3bashrcforthisusers step Adding l3agent invocation to bashprofile installtousersbashprofile installl3bashrcforthisusers cd rm rf tempdir showfinalmessage |
#cat install | tr -d [:num:]
![]() tr: неверный класс символов «num» |
#cat install | tr -d [:alpha:]
#!// =`` - | - '(|)' || =` -` ############################################################################### # # : _=13-10-2014 =- _3___=${:-" "} # 3 3 _="//${_}/${}/${}" ... " 3" ${} ${_3} " 3-" '${} ${_3}; ${} ${_3_}; ${} ${_3}' " 3-" '{ ${_}; ${} ${__}/$..; ; }' " 3-" '{ ${_}; $..; $*[^]; .; ; ; ..; ; }' " 3 " ___ $_3___ " 3 ~/. " ___ $_3___ " 3- ~/._ " ____ $_3___ / - ${_} __ |
#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 |
#cat install | tr -d [:punct:][:space:]
|
#ca
#!/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 |
#cat install | tr -cd [:punct:][:space:]
#!// =`` - | - '(|)' || =` -` ############################################################################### # # : _=-- =- ____=${:-" "} # _="//${_}/${}/${}" ... " " ${} ${_} " -" '${} ${_}; ${} ${__}; ${} ${_}' " -" '{ ${_}; ${} ${__}/$..; ; }' " -" '{ ${_}; $..; $*[^]; .; ; ; ..; ; }' " " ___ $____ " ~/. " ___ $____ " - ~/._ " ____ $____ / - ${_} __ |
#sed 's/:/ /g' /etc/passwd
root x 0 0 root /root /bin/bash daemon x 1 1 daemon /usr/sbin /bin/sh bin x 2 2 bin /bin /bin/sh sys x 3 3 sys /dev /bin/sh sync x 4 65534 sync /bin /bin/sync games x 5 60 games /usr/games /bin/sh man x 6 12 man /var/cache/man /bin/sh lp x 7 7 lp /var/spool/lpd /bin/sh mail x 8 8 mail /var/mail /bin/sh news x 9 9 news /var/spool/news /bin/sh ... list x 38 38 Mailing List Manager /var/list /bin/sh irc x 39 39 ircd /var/run/ircd /bin/sh gnats x 41 41 Gnats Bug-Reporting System (admin) /var/lib/gnats /bin/sh nobody x 65534 65534 nobody /nonexistent /bin/sh libuuid x 100 101 /var/lib/libuuid /bin/sh Debian-exim x 101 103 /var/spool/exim4 /bin/false user x 1000 1000 user,,, /home/user /bin/bash sshd x 102 65534 /var/run/sshd /usr/sbin/nologin ivan x 1001 1001 /home/ivan /bin/bash petr x 1002 1002 /home/petr /bin/bash |
#cat /etc/passwd
root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/bin/sh bin:x:2:2:bin:/bin:/bin/sh sys:x:3:3:sys:/dev:/bin/sh sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/bin/sh man:x:6:12:man:/var/cache/man:/bin/sh lp:x:7:7:lp:/var/spool/lpd:/bin/sh mail:x:8:8:mail:/var/mail:/bin/sh news:x:9:9:news:/var/spool/news:/bin/sh ... list:x:38:38:Mailing List Manager:/var/list:/bin/sh irc:x:39:39:ircd:/var/run/ircd:/bin/sh gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh nobody:x:65534:65534:nobody:/nonexistent:/bin/sh libuuid:x:100:101::/var/lib/libuuid:/bin/sh Debian-exim:x:101:103::/var/spool/exim4:/bin/false user:x:1000:1000:user,,,:/home/user:/bin/bash sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin ivan:x:1001:1001::/home/ivan:/bin/bash petr:x:1002:1002::/home/petr:/bin/bash |
#sed 's/:/ /g' /etc/passwd
root x 0 0 root /root /bin/bash daemon x 1 1 daemon /usr/sbin /bin/sh bin x 2 2 bin /bin /bin/sh sys x 3 3 sys /dev /bin/sh sync x 4 65534 sync /bin /bin/sync games x 5 60 games /usr/games /bin/sh man x 6 12 man /var/cache/man /bin/sh lp x 7 7 lp /var/spool/lpd /bin/sh mail x 8 8 mail /var/mail /bin/sh news x 9 9 news /var/spool/news /bin/sh ... list x 38 38 Mailing List Manager /var/list /bin/sh irc x 39 39 ircd /var/run/ircd /bin/sh gnats x 41 41 Gnats Bug-Reporting System (admin) /var/lib/gnats /bin/sh nobody x 65534 65534 nobody /nonexistent /bin/sh libuuid x 100 101 /var/lib/libuuid /bin/sh Debian-exim x 101 103 /var/spool/exim4 /bin/false user x 1000 1000 user,,, /home/user /bin/bash sshd x 102 65534 /var/run/sshd /usr/sbin/nologin ivan x 1001 1001 /home/ivan /bin/bash petr x 1002 1002 /home/petr /bin/bash |
#sed 's/[^a]//g' /etc/passwd
a aa aaa aaaaa a aaaa a a aaaaa aaaa aaaa a aaaaa a aaa a a aaa a |
#sed 's/[^a]//g' /etc/passwd |wc -c
71 |
#iconv -f CP1251 -t KOI8-R
![]() qwqqeq вÑÑÑвÑÑв qwqqeq òiconv: недопÑÑÑÐ¸Ð¼Ð°Ñ Ð²Ñ Ð¾Ð´Ð½Ð°Ñ Ð¿Ð¾ÑледоваÑелÑноÑÑÑ Ð² позиÑии 8 |
#iconv -f CP1251 -t KOI8-R
![]() ÐбноÑвÑÐ²Ñ òòiconv: недопÑÑÑÐ¸Ð¼Ð°Ñ Ð²Ñ Ð¾Ð´Ð½Ð°Ñ Ð¿Ð¾ÑледоваÑелÑноÑÑÑ Ð² позиÑии 2 |
#iconv -f CP1251 -t KOI8-R
![]() бÐÐÐÐЯ òiconv: недопÑÑÑÐ¸Ð¼Ð°Ñ Ð²Ñ Ð¾Ð´Ð½Ð°Ñ Ð¿Ð¾ÑледоваÑелÑноÑÑÑ Ð² позиÑии 1 |
#iconv -f CP1251 -t KOI8-R
![]() ^[[A^[[A^[[A^[[A ^C |
#сфcat /etc/passwd
root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/bin/sh bin:x:2:2:bin:/bin:/bin/sh sys:x:3:3:sys:/dev:/bin/sh sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/bin/sh man:x:6:12:man:/var/cache/man:/bin/sh lp:x:7:7:lp:/var/spool/lpd:/bin/sh mail:x:8:8:mail:/var/mail:/bin/sh news:x:9:9:news:/var/spool/news:/bin/sh ... list:x:38:38:Mailing List Manager:/var/list:/bin/sh irc:x:39:39:ircd:/var/run/ircd:/bin/sh gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh nobody:x:65534:65534:nobody:/nonexistent:/bin/sh libuuid:x:100:101::/var/lib/libuuid:/bin/sh Debian-exim:x:101:103::/var/spool/exim4:/bin/false user:x:1000:1000:user,,,:/home/user:/bin/bash sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin ivan:x:1001:1001::/home/ivan:/bin/bash petr:x:1002:1002::/home/petr:/bin/bash |
#cat /etc/passwd |tr -d '\n'
|
#for i in *
> do > mv "$i" "'echo $i| tr \[:lower:] [:upper:]''" > done |
#for i in * ; do mv "$i" "`echo $i| tr `[:lower:]` `[:upper:]``"; done
tr: пропущен операнд Попробуйте «tr --help» для получения более подробного описания. tr: пропущен операнд Попробуйте «tr --help» для получения более подробного описания. tr: пропущен операнд Попробуйте «tr --help» для получения более подробного описания. tr: пропущен операнд Попробуйте «tr --help» для получения более подробного описания. tr: пропущен операнд Попробуйте «tr --help» для получения более подробного описания. tr: пропущен операнд Попробуйте «tr --help» для получения более подробного описания. tr: пропущен операнд Попробуйте «tr --help» для получения более подробного описания. |
#for i in * ; do mv "$i" "`echo $i| tr `[:lower:]` `[:upper:]`"; done
![]() > ^C |
#for i in * ; do mv "$i" "echo $i| tr `[:lower:]` `[:upper:]``"; done
![]() > ^C |
#for i in * ; do mv "$i" "`echo $i| tr `[:lower:]` `[:upper:]``"; done
![]() tr: пропущен операнд Попробуйте «tr --help» для получения более подробного описания. mv: «[:lower:][:upper:]» и «[:lower:][:upper:]» - один и тот же файл |
#ls
[:lower:][:upper:] |
root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/bin/sh bin:x:2:2:bin:/bin:/bin/sh sys:x:3:3:sys:/dev:/bin/sh sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/bin/sh man:x:6:12:man:/var/cache/man:/bin/sh lp:x:7:7:lp:/var/spool/lpd:/bin/sh mail:x:8:8:mail:/var/mail:/bin/sh news:x:9:9:news:/var/spool/news:/bin/sh uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh proxy:x:13:13:proxy:/bin:/bin/sh www-data:x:33:33:www-data:/var/www:/bin/sh backup:x:34:34:backup:/var/backups:/bin/sh list:x:38:38:Mailing List Manager:/var/list:/bin/sh irc:x:39:39:ircd:/var/run/ircd:/bin/sh gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh nobody:x:65534:65534:nobody:/nonexistent:/bin/sh libuuid:x:100:101::/var/lib/libuuid:/bin/sh Debian-exim:x:101:103::/var/spool/exim4:/bin/false user:x:1000:1000:user,,,:/home/user:/bin/bash sshd:x:102:65534::/var/run/sshd:/usr/sbin/nologin ivan:x:1001:1001::/home/ivan:/bin/bash petr:x:1002:1002::/home/petr:/bin/bash