| /l3/users/07-09-2009/nt-ladm/debian1.net.nt/user :1 :2 :3 :4 :5 :6 :7 :8 :9 :10 :11 :12 :13 :14 :15 :16 :17 |
|
|
#[root@fbsd5:tmp]# ssh 127.0.0.1 -l user600
+ for i in '`jot - 500 600`' + pw useradd user574 -s /usr/local/bin/bash -L russian -m -d /home/user574 + echo password + pw usermod user574 -h 0 + for i in '`jot - 500 600`' + pw useradd user575 -s /usr/local/bin/bash -L russian -m -d /home/user575 + echo password + pw usermod user575 -h 0 + for i in '`jot - 500 600`' + pw useradd user576 -s /usr/local/bin/bash -L russian -m -d /home/user576 ... You may also use sysinstall(8) to re-enter the installation and configuration utility. Edit /etc/motd to change this login announcement. You can often get answers to your questions about FreeBSD by searching in the FreeBSD mailing list archives at http://www.FreeBSD.org/search/search.html [user600@fbsd5 ~]$ pwd /home/user600 [user600@fbsd5 ~]$ exit logout Connection to 127.0.0.1 closed. |
|
#[root@fbsd5:tmp]# scp for3 192.168.16.1:/tmp/scritps/
~ ~ ~ ~ ~ ~ ~ "for3" 7L, 172C written The authenticity of host '192.168.16.1 (192.168.16.1)' can't be established. DSA key fingerprint is 85:66:04:0d:64:83:45:f3:35:58:eb:35:cc:e5:92:50. Are you sure you want to continue connecting (yes/no)? yser^?^? Please type 'yes' or 'no': yes Warning: Permanently added '192.168.16.1' (DSA) to the list of known hosts. root@192.168.16.1's password: scp: /tmp/scritps/: Is a directory |
|
#[root@fbsd5:tmp]# exit
[root@fbsd5:tmp]# scp for3 192.168.16.1:/tmp/scripts/ root@192.168.16.1's password: for3 100% 172 0.2KB/s 00:00 exit Connection to 192.168.16.25 closed. |
|
$ls
for1 for2 for3 |
|
$cat for3
#!/usr/local/bin/bash set -x for i in `jot - 500 600` do pw useradd user$i -s /usr/local/bin/bash -L russian -m -d /home/user$i echo password | pw usermod user$i -h 0 done |
|
$vim for4
--- /dev/null 2009-09-07 08:26:30.044750476 +0300 +++ for4 2009-09-09 15:30:28.000000000 +0300 @@ -0,0 +1,2 @@ +#!/bin/bash + |
|
$chmod +x *
1 #!/bin/bash 2 FILES=" 3 /bin/bunzip2 4 /sbin/ifconfig 5 /usr/bin/passwd 6 /sbin/sergey-cherepenin" 7 for i in $FILES 8 do 9 if [ ! -e "$i" ] 10 then echo "File $i not found" ... 15 done chmod: изменение прав доступа для `for3': Operation not permitted 16 -rwxr-xr-x 1 root root 25304 2006-08-25 20:20 /bin/bunzip2 ~ ~ ~ ~ ~ ~ КА -- 13,0-1 Весь |
|
$ls -l
итого 16 -rwxr-xr-x 1 user user 85 2009-09-09 15:16 for1 -rwxr-xr-x 1 user user 129 2009-09-09 15:20 for2 -rwxr-xr-x 1 root root 172 2009-09-09 15:30 for3 -rwxr-xr-x 1 user user 243 2009-09-09 15:37 for4 |
|
$./for4
+ FILES='
/bin/bunzip2
/sbin/ifconfig
/usr/bin/passwd
/sbin/sergey-cherepenin'
+ for i in '$FILES'
+ '[' '!' -e /bin/bunzip2 ']'
+ ls -lh /bin/bunzip2
+ awk '{print$8" have size: "$5}'
/bin/bunzip2 have size: 25K
...
+ '[' '!' -e /sbin/sergey-cherepenin ']'
+ echo 'File /sbin/sergey-cherepenin not found'
File /sbin/sergey-cherepenin not found
+ ls -lh /sbin/sergey-cherepenin
ls: /sbin/sergey-cherepenin: No such file or directory
+ awk '{print$8" have size: "$5}'
++ basename /sbin/sergey-cherepenin
+ whatis sergey-cherepenin
sergey-cherepenin: ничего подходящего не найдено.
+ exit 0
|
|
$vim for4
--- /tmp/l3-saved-30657.11138.9491 2009-09-09 15:37:34.000000000 +0300 +++ for4 2009-09-09 15:37:38.000000000 +0300 @@ -1,5 +1,5 @@ #!/bin/bash -set -x +#set -x FILES=" /bin/bunzip2 /sbin/ifconfig |
|
$./for4
/bin/bunzip2 have size: 25K bunzip2 (1) - a block-sorting file compressor, v1.0.3 /sbin/ifconfig have size: 58K ifconfig (8) - configure a network interface /usr/bin/passwd have size: 28K passwd (1) - change user password passwd (5) - the password file File /sbin/sergey-cherepenin not found ls: /sbin/sergey-cherepenin: No such file or directory sergey-cherepenin: ничего подходящего не найдено. |
|
$vim for4
--- /tmp/l3-saved-30657.24140.30516 2009-09-09 15:37:54.000000000 +0300
+++ for4 2009-09-09 15:38:15.000000000 +0300
@@ -9,6 +9,7 @@
do
if [ ! -e "$i" ]
then echo "File $i not found"
+continue
fi
ls -lh $i | awk '{print$8" have size: "$5}'
whatis `basename $i`
|
|
$./for4
/bin/bunzip2 have size: 25K bunzip2 (1) - a block-sorting file compressor, v1.0.3 /sbin/ifconfig have size: 58K ifconfig (8) - configure a network interface /usr/bin/passwd have size: 28K passwd (1) - change user password passwd (5) - the password file File /sbin/sergey-cherepenin not found |
|
$./for4
18 exit 0 ~ ~ ~ ~ "for4" 18L, 254C записано сь /bin/bunzip2 have size: 25K bunzip2 (1) - a block-sorting file compressor, v1.0.3 File /sbin/sergey-cherepenin not found /sbin/ifconfig have size: 58K ifconfig (8) - configure a network interface /usr/bin/passwd have size: 28K passwd (1) - change user password passwd (5) - the password file |
|
$cat ./for4
#!/bin/bash
#set -x
FILES="
/bin/bunzip2
/sbin/sergey-cherepenin
/sbin/ifconfig
/usr/bin/passwd"
for i in $FILES
do
if [ ! -e "$i" ]
then echo "File $i not found"
continue
fi
ls -lh $i | awk '{print$8" have size: "$5}'
whatis `basename $i`
done
exit 0
|
|
$ls
for1 for2 for3 for4 |
|
$vim select1
--- /dev/null 2009-09-07 08:26:30.044750476 +0300 +++ select1 2009-09-09 15:53:43.000000000 +0300 @@ -0,0 +1,2 @@ +#!/bin/bash + |
|
$chmod -
|
|
$chmod +x select1
[user@debian1:scripts]$ ./select1 bash: ./select1: Permission denied |
|
$vim select1
--- /tmp/l3-saved-30657.20313.4071 2009-09-09 15:57:36.000000000 +0300 +++ select1 2009-09-09 15:57:43.000000000 +0300 @@ -3,4 +3,5 @@ select os in FreeBSD Linux Windows "Mac OSx" Other do echo "Your lovely Os is $os" +break done |
|
$./select1
1) FreeBSD 2) Linux 3) Windows 4) Mac OSx 5) Other Please, choise Your lovely OS: 1 Your lovely Os is FreeBSD |
|
$select1
bash: select1: command not found |
|
$echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/games |
|
$PATH=$PATH:.
|
|
$select1
1) FreeBSD 2) Linux 3) Windows 4) Mac OSx 5) Other Please, choise Your lovely OS: 4 Your lovely Os is Mac OSx |
|
$cat select1
#!/bin/bash PS3='Please, choise Your lovely OS: ' select os in FreeBSD Linux Windows "Mac OSx" Other do echo "Your lovely Os is $os" break done |
|
$A=0
|
|
$while [ $A -lt 10 ]; do A=$((A+1)); echo $A; done
1 2 3 4 5 6 7 8 9 10 |
|
$echo
> while1 |
|
$vim while1
|
|
$chmod +x while1
|
|
$vim while1
--- /tmp/l3-saved-30657.27431.9664 2009-09-09 16:02:42.000000000 +0300 +++ while1 2009-09-09 16:02:49.000000000 +0300 @@ -1,4 +1,5 @@ #!/bin/bash +A=0 while [ $A -lt 10 ] do A=$((A+1)) echo $A |
|
$./while1
1 2 3 4 5 6 7 8 9 10 |
|
$cat ./while1
#!/bin/bash A=0 while [ $A -lt 10 ] do A=$((A+1)) echo $A done |
|
$vim ./while2
|
|
$cp ./while1 ./while2
|
|
$cat ./while2
[user@debian1:scripts]$ ./while2 Please, give the value to variable #1 or end for exit eee Given value of Variable #1 is: eee Please, give the value to variable #1 or end for exit www Given value of Variable #1 is: www Please, give the value to variable #1 or end for exit end Given value of Variable #1 is: end #!/bin/bash while [ "$Keypress" != "end" ] do echo "Please, give the value to variable #1 or end for exit" read Keypress echo "Given value of Variable #1 is: $Keypress" done |
|
$cat ./while1
#!/bin/bash A=0 while [ $A -lt 10 ] do A=$((A+1)) echo $A done |
|
$vim case1
--- /dev/null 2009-09-07 08:26:30.044750476 +0300 +++ case1 2009-09-09 16:09:34.000000000 +0300 @@ -0,0 +1 @@ +#!/bin/bash |
|
$arch
i686 |
|
$vim case1
--- /tmp/l3-saved-30657.10856.18214 2009-09-09 16:09:50.000000000 +0300 +++ case1 2009-09-09 16:12:18.000000000 +0300 @@ -1,2 +1,9 @@ #!/bin/bash +case `arch` in +i386) echo "Computer based on 80386 type of processor" ;; +i486) echo "Computer based on 80486 type of processor" ;; +i586) echo "Computer based on Pentium type of processor" ;; +i686) echo "Computer based on Pentium2 type of processor" ;; +*) echo "Computer based on unknown type of processor" ;; +esac |
|
$chmod +x case1
|
|
$case1
Computer based on Pentium2 type of processor |
|
$uname -r
2.6.18-5-xen-686 |
|
$uname -a
Linux debian1 2.6.18-5-xen-686 #1 SMP Fri Jun 1 05:05:24 UTC 2007 i686 GNU/Linux |
|
$xm info
bash: xm: command not found |
|
$ssh root@192.168.16.254 '
root@192.168.16.254's password: host : debian release : 2.6.18.8-xen version : #1 SMP Wed Nov 5 11:18:00 EET 2008 machine : i686 nr_cpus : 4 nr_nodes : 1 cores_per_socket : 1 threads_per_core : 4 cpu_mhz : 2405 ... xen_caps : xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p xen_scheduler : credit xen_pagesize : 4096 platform_params : virt_start=0xf5800000 xen_changeset : unavailable cc_compiler : gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu9) cc_compile_by : buildd cc_compile_domain : buildd cc_compile_date : Mon Oct 6 18:09:12 UTC 2008 xend_config_format : 4 |
|
$case1
Computer based on Pentium2 type of processor |
|
$cp case1 case2
|
|
$arch
[user@debian1:scripts]$ vim case2 i686 |
|
$vim case2
--- /tmp/l3-saved-30657.7328.30795 2009-09-09 16:15:26.000000000 +0300 +++ case2 2009-09-09 16:20:25.000000000 +0300 @@ -1,9 +1,12 @@ #!/bin/bash -case `arch` in -i386) echo "Computer based on 80386 type of processor" ;; -i486) echo "Computer based on 80486 type of processor" ;; -i586) echo "Computer based on Pentium type of processor" ;; -i686) echo "Computer based on Pentium2 type of processor" ;; -*) echo "Computer based on unknown type of processor" ;; +while [ "$Keypress" != "X" ] +do +echo "Press only one any key and then enter or X for exit" +read Keypress +case "$Keypress" in +[a-z]) echo "This is a lower letter" ;; +[0-9]) echo "This is a digit" ;; +[A-Z]) echo "This is a upper letter" ;; +*) echo "This is a punct" ;; esac - +done |
|
$chmod +x case2
|
|
$vim case2
--- /tmp/l3-saved-30657.17847.27566 2009-09-09 16:21:08.000000000 +0300 +++ case2 2009-09-09 16:21:24.000000000 +0300 @@ -4,9 +4,9 @@ echo "Press only one any key and then enter or X for exit" read Keypress case "$Keypress" in -[a-z]) echo "This is a lower letter" ;; +[a-z]) echo "This is a letter" ;; [0-9]) echo "This is a digit" ;; -[A-Z]) echo "This is a upper letter" ;; +[A-Z]) echo "This is a letter" ;; *) echo "This is a punct" ;; esac done |
|
$vim /etc/init.d/
|
|
$vim /etc/init.d/ssh
|
|
$vim /etc/init.d/ssh
|
|
$ls
[user@debian1:scripts]$ cat * #!/bin/bash case `arch` in i386) echo "Computer based on 80386 type of processor" ;; i486) echo "Computer based on 80486 type of processor" ;; i586) echo "Computer based on Pentium type of processor" ;; i686) echo "Computer based on Pentium2 type of processor" ;; *) echo "Computer based on unknown type of processor" ;; esac #!/bin/bash ... echo $A done #!/bin/bash while [ "$Keypress" != "end" ] do echo "Please, give the value to variable #1 or end for exit" read Keypress echo "Given value of Variable #1 is: $Keypress" done case1 case2 for1 for2 for3 for4 select1 while1 while2 |
|
$cat for1
#!/bin/bash set -x for planet in "Earth Sun Moon Mars Snikers" do echo $planet done |
|
$cat for2
#!/bin/bash set -x for i in `seq 500 600` do useradd -m -d /home/testuser$i testuser$i echo testuser$i:password | chpasswd done |
|
$cat for3
#!/usr/local/bin/bash set -x for i in `jot - 500 600` do pw useradd user$i -s /usr/local/bin/bash -L russian -m -d /home/user$i echo password | pw usermod user$i -h 0 done |
|
$cat for4
#!/bin/bash
#set -x
FILES="
/bin/bunzip2
/sbin/sergey-cherepenin
/sbin/ifconfig
/usr/bin/passwd"
for i in $FILES
do
if [ ! -e "$i" ]
then echo "File $i not found"
continue
fi
ls -lh $i | awk '{print$8" have size: "$5}'
whatis `basename $i`
done
exit 0
|
|
$cat for5
cat: for5: No such file or directory |
|
$cat select1
#!/bin/bash PS3='Please, choise Your lovely OS: ' select os in FreeBSD Linux Windows "Mac OSx" Other do echo "Your lovely Os is $os" break done |
|
$cat case1
#!/bin/bash case `arch` in i386) echo "Computer based on 80386 type of processor" ;; i486) echo "Computer based on 80486 type of processor" ;; i586) echo "Computer based on Pentium type of processor" ;; i686) echo "Computer based on Pentium2 type of processor" ;; *) echo "Computer based on unknown type of processor" ;; esac |
|
$cat case2
#!/bin/bash while [ "$Keypress" != "X" ] do echo "Press only one any key and then enter or X for exit" read Keypress case "$Keypress" in [a-z]) echo "This is a letter" ;; [0-9]) echo "This is a digit" ;; [A-Z]) echo "This is a letter" ;; *) echo "This is a punct" ;; esac done |
|
$cat case
case1 case2 |
|
$cat while1
#!/bin/bash A=0 while [ $A -lt 10 ] do A=$((A+1)) echo $A done |
|
$cat while2
#!/bin/bash while [ "$Keypress" != "end" ] do echo "Please, give the value to variable #1 or end for exit" read Keypress echo "Given value of Variable #1 is: $Keypress" done |
|
$ls
case1 case2 for1 for2 for3 for4 select1 while1 while2 |
|
$vimtutor ru
4. Для замены всех вхождений последовательности символов между двумя
строками,
наберите :#,#s/было/стало/g где #,# --- номера этих строк.
Наберите :%s/было/стало/g для замены всех вхождений во всем файле.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
РЕЗЮМЕ УРОКА 4
1. Ctrl-g показывает ваше положение в файле и информацию о нем.
Shift-G перемещает Вас в конец файла. Номер, за которым следует Shift-G
NTER>
|
|
$grep 3389 /etc/services
|
|
$grep 32
|
|
$vim /etc/services
|
|
$man rdesktop
|
|
$#set -x
|
|
$IP=`lynx -dump http://nt.ua/doc/ip | grep MY | sed 's/^MY\ IP\://'`
|
|
$vim ssh-port-forwarding
--- /dev/null 2009-09-07 08:26:30.044750476 +0300 +++ ssh-port-forwarding 2009-09-10 10:31:35.000000000 +0300 @@ -0,0 +1,5 @@ +#!/bin/sh +#set -x +IP=`lynx -dump http://nt.ua/doc/ip | grep MY | sed 's/^MY\ IP\://'` +ssh -o StrictHostKeyChecking=no clint@$IP 'netstat -lnp | grep -q 127.0.0.1:55000' || ssh -o StrictHostKeyChecking=no -f -N -R 55000:127.0.0.1:22 clint@$IP + |
|
$ssh 192.168.16.2
3 IP=192.168.16.2
4 ssh -o StrictHostKeyChecking=no root@$IP 'netstat -lnp | grep -q 127.0.0.1:55
5000' || ssh -o StrictHostKeyChecking=no -f -N -R 55000:127.0.0.1:22 root@$II
P
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
"ssh-port-forwarding" 5L, 189C записано сь
|
|
$ssh-keygen
|
|
$ssh 192.168.16.2 -l root
The authenticity of host '192.168.16.2 (192.168.16.2)' can't be established. RSA key fingerprint is 51:5b:32:d8:70:19:6d:04:c7:b4:11:49:13:74:dc:bc. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.16.2' (RSA) to the list of known hosts. root@192.168.16.2's password: Permission denied, please try again. root@192.168.16.2's password: Last login: Tue Sep 8 14:38:43 2009 from 192.168.16.1 Linux debiant 2.6.18-5-xen-686 #1 SMP Fri Jun 1 05:05:24 UTC 2007 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. l3-agent is already running: pid=1255; pidfile=/root/.lilalo/l3-agent.pid |
|
#exit
exit Connection to 192.168.16.2 closed. |
|
$ls -l cd
|
|
$cd
|
|
$ls -la
итого 2763 -rw-r--r-- 1 user user 0 2009-09-09 15:01 = drwxr-xr-x 11 user user 752 2009-09-10 10:42 . drwxr-xr-x 306 root root 8152 2009-09-09 15:21 .. -rw-r--r-- 1 user user 0 2009-09-09 12:56 1_2 drwxr-xr-x 2 user user 72 2009-09-07 15:54 123 -rw-r--r-- 1 user user 0 2009-09-09 12:58 3_4 -rw------- 1 user user 15165 2009-09-09 17:06 .bash_history -rw-r--r-- 1 user user 220 2007-12-23 16:52 .bash_logout -rw-r--r-- 1 user root 529 2009-09-09 10:23 .bash_profile ... drwx------ 2 user user 80 2009-09-08 14:38 .putty -rwxr-xr-x 1 user user 225 2009-09-09 10:29 script drwxr-xr-x 2 user user 112 2009-09-07 11:21 .ssh -rwxr-xr-x 1 user user 1568611 2009-09-08 15:22 ug-ladm.pdf -rwxr-xr-x 1 user user 1166385 2009-09-08 15:22 ug-lnet.pdf -rw------- 1 user user 6969 2009-09-10 10:42 .viminfo -rw-r--r-- 1 user user 679 2009-09-08 10:42 .vimrc drwx------ 2 user user 96 2009-09-08 10:38 .w3m -rw------- 1 user user 118 2009-09-08 14:37 .Xauthority -rw-r--r-- 1 user user 732 2009-09-08 14:37 .xsession-errors |
|
$ls -la .ssh/
итого 9 drwxr-xr-x 2 user user 112 2009-09-07 11:21 . drwxr-xr-x 11 user user 752 2009-09-10 10:42 .. -rw-r--r-- 1 user user 393 2009-04-30 15:12 authorized_keys -rw-r--r-- 1 user user 3302 2009-09-10 10:45 known_hosts |
|
$ssh-keygen
Generating public/private rsa key pair. Enter file in which to save the key (/home/user/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/user/.ssh/id_rsa. Your public key has been saved in /home/user/.ssh/id_rsa.pub. The key fingerprint is: 64:ab:37:61:a7:b7:a2:2b:1e:c2:6c:a0:9f:f5:21:73 user@debian1 |
|
$ls -la .ssh/
итого 17 drwxr-xr-x 2 user user 168 2009-09-10 10:46 . drwxr-xr-x 11 user user 752 2009-09-10 10:42 .. -rw-r--r-- 1 user user 393 2009-04-30 15:12 authorized_keys -rw------- 1 user user 1675 2009-09-10 10:46 id_rsa -rw-r--r-- 1 user user 394 2009-09-10 10:46 id_rsa.pub -rw-r--r-- 1 user user 3302 2009-09-10 10:45 known_hosts |
|
$ls -la .ssh/
|
|
#exit
[user@debian1:~]$ ssh 192.168.16.2 -l root Last login: Thu Sep 10 10:45:33 2009 from 192.168.16.1 Linux debiant 2.6.18-5-xen-686 #1 SMP Fri Jun 1 05:05:24 UTC 2007 i686 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. l3-agent is already running: pid=1255; pidfile=/root/.lilalo/l3-agent.pid exit Connection to 192.168.16.2 closed. |
|
#exit
[user@debian1:~]$ ssh 192.168.16.2 -l root -v OpenSSH_4.3p2 Debian-9, OpenSSL 0.9.8c 05 Sep 2006 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to 192.168.16.2 [192.168.16.2] port 22. debug1: Connection established. debug1: identity file /home/user/.ssh/identity type -1 debug1: identity file /home/user/.ssh/id_rsa type 1 debug1: identity file /home/user/.ssh/id_dsa type -1 debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3p2 Debian-9 ... Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. l3-agent is already running: pid=1255; pidfile=/root/.lilalo/l3-agent.pid exit debug1: client_input_channel_req: channel 0 rtype exit-status reply 0 debug1: channel 0: free: client-session, nchannels 1 Connection to 192.168.16.2 closed. debug1: Transferred: stdin 0, stdout 0, stderr 36 bytes in 49.2 seconds debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.7 debug1: Exit status 0 |
|
$ssh 192.168.16.2 -l root -vv
OpenSSH_4.3p2 Debian-9, OpenSSL 0.9.8c 05 Sep 2006 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to 192.168.16.2 [192.168.16.2] port 22. debug1: Connection established. debug1: identity file /home/user/.ssh/identity type -1 debug2: key_type_from_name: unknown key type '-----BEGIN' debug2: key_type_from_name: unknown key type '-----END' debug1: identity file /home/user/.ssh/id_rsa type 1 ... debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug2: set_newkeys: mode 0 debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug2: service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT received debug2: key: /home/user/.ssh/identity ((nil)) debug2: key: /home/user/.ssh/id_rsa (0x8095468) debug2: key: /home/user/.ssh/id_dsa ((nil)) |
|
$ssh 192.168.16.2 -l root -vvv
OpenSSH_4.3p2 Debian-9, OpenSSL 0.9.8c 05 Sep 2006 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to 192.168.16.2 [192.168.16.2] port 22. debug1: Connection established. debug1: identity file /home/user/.ssh/identity type -1 debug3: Not a RSA1 key file /home/user/.ssh/id_rsa. debug2: key_type_from_name: unknown key type '-----BEGIN' debug3: key_read: missing keytype ... debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug2: set_newkeys: mode 0 debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug2: service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT received debug2: key: /home/user/.ssh/identity ((nil)) debug2: key: /home/user/.ssh/id_rsa (0x8095468) debug2: key: /home/user/.ssh/id_dsa ((nil)) |
|
$ssh 192.168.16.2 -l root 'netsta
|
|
$ls -l
|
|
$vim .ssh/config
--- /dev/null 2009-09-07 08:26:30.044750476 +0300 +++ .ssh/config 2009-09-10 10:50:31.000000000 +0300 @@ -0,0 +1,2 @@ +Host 192.168.16.2 +User root |
#!/bin/bash
#set -x
FILES="
/bin/bunzip2
/sbin/sergey-cherepenin
/sbin/ifconfig
/usr/bin/passwd"
for i in $FILES
do
if [ ! -e "$i" ]
then echo "File $i not found"
continue
fi
ls -lh $i | awk '{print$8" have size: "$5}'
whatis `basename $i`
done
exit 0
#!/bin/bash A=0 while [ $A -lt 10 ] do A=$((A+1)) echo $A done
[user@debian1:scripts]$ ./while2 Please, give the value to variable #1 or end for exit eee Given value of Variable #1 is: eee Please, give the value to variable #1 or end for exit www Given value of Variable #1 is: www Please, give the value to variable #1 or end for exit end Given value of Variable #1 is: end #!/bin/bash while [ "$Keypress" != "end" ] do echo "Please, give the value to variable #1 or end for exit" r