/l3/users/slm/2018-12-minsk-aws/instructor.BigClassRoom/user :1 :2 |
|
$vim hello.md
|
$git diff
diff --git a/hello.md b/hello.md index 98ad2f9..dd65a6a 100644 --- a/hello.md +++ b/hello.md @@ -1,7 +1,11 @@ +## Introduction + +Introduction to the hello/goodbye topic. + ## Hello Hello **world** ## Goodbye -Goodbye world +Goodbye **world** |
$git status
On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: hello.md no changes added to commit (use "git add" and/or "git commit -a") |
$git add -p
diff --git a/hello.md b/hello.md index 98ad2f9..dd65a6a 100644 --- a/hello.md +++ b/hello.md @@ -1,7 +1,11 @@ +## Introduction + +Introduction to the hello/goodbye topic. + ## Hello ... Hello **world** ## Goodbye Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? n @@ -1,7 +5,7 @@ ## Hello Hello **world** ## Goodbye -Goodbye world +Goodbye **world** Stage this hunk [y,n,q,a,d,/,K,g,e,?]? y |
$git commit -m 'goodbye world formatting (fixes #1)'
[master 33d7de2] goodbye world formatting (fixes #1) 1 file changed, 1 insertion(+), 1 deletion(-) |
$git commit -m 'added introduction'
[master 2881368] added introduction 1 file changed, 4 insertions(+) |
$git push
Username for 'https://github.com': sl-2018-12 Password for 'https://sl-2018-12@github.com': Counting objects: 6, done. Delta compression using up to 4 threads. Compressing objects: 100% (6/6), done. Writing objects: 100% (6/6), 610 bytes | 0 bytes/s, done. Total 6 (delta 2), reused 0 (delta 0) remote: Resolving deltas: 100% (2/2), completed with 1 local object. To https://github.com/sl-2018-12/aws 89856e9..2881368 master -> master |
$poweroff
bash: poweroff: command not found |
$/sbin/ifconfig
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.20.13.183 netmask 255.255.255.128 broadcast 172.20.13.255 inet6 fe80::3285:a9ff:fe9e:10aa prefixlen 64 scopeid 0x20<link> ether 30:85:a9:9e:10:aa txqueuelen 1000 (Ethernet) RX packets 1276 bytes 451436 (440.8 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 840 bytes 99708 (97.3 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1 (Local Loopback) RX packets 231 bytes 42292 (41.3 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 231 bytes 42292 (41.3 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 |
$# www.yasiv.com/github/
|
$# gitstar-ranking.com/user/
|
$grep user10
1.json .cache/ github.txt .local/ q- aws/ .config/ .gnupg/ .mozilla/ .ssh/ .bash_history Desktop/ .ICEauthority Music/ Templates/ .bash_logout Documents/ .l3rc Pictures/ Videos/ .bash_profile Downloads/ .lesshst .profile .viminfo .bashrc .gitconfig .lilalo/ Public/ .vimrc |
$grep user10
1.json .cache/ github.txt .local/ q- aws/ .config/ .gnupg/ .mozilla/ .ssh/ .bash_history Desktop/ .ICEauthority Music/ Templates/ .bash_logout Documents/ .l3rc Pictures/ Videos/ .bash_profile Downloads/ .lesshst .profile .viminfo .bashrc .gitconfig .lilalo/ Public/ .vimrc |
$ssh m2
ssh: Could not resolve hostname m2: Name or service not known |
$ssh root@m2
ssh: Could not resolve hostname m2: Name or service not known |
$cat credentials.csv
user10,XXXXXXUr)8qx,XXXXXX5YKZDPMPLU7NMA,XXXXXXXXi2nOUIKxfRV1/ETIM2/EUR7Ks1Hr1QJ+,https://chubin.signin.aws.amazon.com/console |
$cat credentials.csv | tr , '\n'
user10 XXXXXXUr)8qx XXXXXX5YKZDPMPLU7NMA XXXXXXXXi2nOUIKxfRV1/ETIM2/EUR7Ks1Hr1QJ+ https://chubin.signin.aws.amazon.com/console |
$curl cheat.sh/latencies
# Latency numbers every programmer should know 1ns Main memory reference: Send 2,000 bytes Read 1,000,000 bytes ▗▖ 100ns over commodity network: sequentially from SSD: 77us ▗▖ 88ns ▗ L1 cache reference: 1ns ▗ ▗▖ 1us Disk seek: 2ms ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ SSD random read: 16us ▗▖▗▖▗ Branch mispredict: 3ns ▗▖ ▗▖▗▖▗▖ Read 1,000,000 bytes Compress 1KB wth Snappy: Read 1,000,000 bytes sequentially from disk: 1ms ... ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ # [github.com/chubin/late.nz] [MIT License] ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ # Console port of "Jeff Dean's latency numbers" ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ # from [github.com/colin-scott/interactive_latencies] ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ ▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖▗▖ |
$vim ~/.ssh/config
|
$vim ~/.ssh/config
|
$cat ~/.ssh/config
Host *.compute.amazonaws.com IdentityFile ~/.ssh/user10.pem User ec2-user # ssh -i ~/.ssh/user10.pem ec2-user@XXXX.compute.amazonaws.com # ssh XXXX.compute.amazonaws.com |
$ls -l
total 52 -rw-r--r-- 1 user user 101 Dec 17 14:38 1.json drwxr-xr-x 3 user user 4096 Dec 17 16:45 aws -rw-r--r-- 1 root root 127 Dec 18 10:53 credentials.csv drwxr-xr-x 2 user user 4096 Dec 17 12:17 Desktop drwxr-xr-x 2 user user 4096 Dec 17 12:17 Documents drwxr-xr-x 2 user user 4096 Dec 18 12:49 Downloads -rw-r--r-- 1 user user 7 Dec 17 15:12 github.txt drwxr-xr-x 2 user user 4096 Dec 17 12:17 Music drwxr-xr-x 2 user user 4096 Dec 17 12:17 Pictures drwxr-xr-x 2 user user 4096 Dec 17 12:17 Public -rw-r--r-- 1 user user 964 Dec 17 14:19 q- drwxr-xr-x 2 user user 4096 Dec 17 12:17 Templates drwxr-xr-x 2 user user 4096 Dec 17 12:17 Videos |
$ls -l Downloads/
total 4 -rw-r--r-- 1 user user 1696 Dec 18 12:49 user10.pem |
$ssh ec2-34-244-93-167.eu-west-1.compute.amazonaws.com
The authenticity of host 'ec2-34-244-93-167.eu-west-1.compute.amazonaws.com (34.244.93.167)' can't be established. ECDSA key fingerprint is SHA256:NeDm7X/nrUXl9EgK7wwdR8PWrM1FPROo9/ZJw9q6pV8. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'ec2-34-244-93-167.eu-west-1.compute.amazonaws.com,34.244.93.167' (ECDSA) to the list of known hosts. no such identity: /home/user/.ssh/user10.pem: No such file or directory Permission denied (publickey,gssapi-keyex,gssapi-with-mic). |
$ssh ec2-34-240-2018-191.eu-west-1.compute.amazonaws.com
ssh: Could not resolve hostname ec2-34-240-2018-191.eu-west-1.compute.amazonaws.com: Name or service not known |
$ssh ec2-34-240-208-191.eu-west-1.compute.amazonaws.com
The authenticity of host 'ec2-34-240-208-191.eu-west-1.compute.amazonaws.com (34.240.208.191)' can't be established. ECDSA key fingerprint is SHA256:TrpGDefwrjpVtvTSd/QsschOy6/KvpO0dadAZtAGbFs. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'ec2-34-240-208-191.eu-west-1.compute.amazonaws.com,34.240.208.191' (ECDSA) to the list of known hosts. no such identity: /home/user/.ssh/user10.pem: No such file or directory Permission denied (publickey,gssapi-keyex,gssapi-with-mic). |
$mv ~/Downloads/user10.pem ~/.ssh/
|
$ls -l ec2-34-240-208-191.eu-west-1.compute.amazonaws.com
ls: cannot access 'ec2-34-240-208-191.eu-west-1.compute.amazonaws.com': No such file or directory |
$chmod 600 ~/.ssh/user10.pem
|
$ssh ec2-34-240-208-191.eu-west-1.compute.amazonaws.com
Last login: Tue Dec 18 12:20:57 2018 from port-90-adslby-pool35.infonet.by __| __|_ ) _| ( / Amazon Linux 2 AMI ___|\___|___| https://aws.amazon.com/amazon-linux-2/ 1 package(s) needed for security, out of 5 available Run "sudo yum update" to apply all updates. @ip-10-2-1-168:~[ec2-user@ip-10-2-1-168 ~]$ exit logout Connection to ec2-34-240-208-191.eu-west-1.compute.amazonaws.com closed. |
$ssh ec2-18-202-236-151.eu-west-1.compute.amazonaws.com
The authenticity of host 'ec2-18-202-236-151.eu-west-1.compute.amazonaws.com (18.202.236.151)' can't be established. ECDSA key fingerprint is SHA256:RFfm5saY5k/hc/H5ffgWGiceAybTGlaXEvrl6YORfaY. Are you sure you want to continue connecting (yes/no)? no Host key verification failed. |
$ssh ec2-52-211-163-20.eu-west-1.compute.amazonaws.com
Last login: Tue Dec 18 13:43:49 2018 from port-90-adslby-pool35.infonet.by __| __|_ ) _| ( / Amazon Linux 2 AMI ___|\___|___| https://aws.amazon.com/amazon-linux-2/ 1 package(s) needed for security, out of 5 available Run "sudo yum update" to apply all updates. @ip-10-2-1-19:~[ec2-user@ip-10-2-1-19 ~]$ sudo -s 10-2-1-19:/home/ec2-user[root@ip-10-2-1-19 ec2-user]# iperf -s bash: iperf: command not found ... 00:05.0 Ethernet controller: Amazon.com, Inc. Elastic Network Adapter (ENA) 00:1e.0 Non-Volatile memory controller: Amazon.com, Inc. Device 8061 00:1f.0 Non-Volatile memory controller: Amazon.com, Inc. NVMe SSD Controller 10-2-1-19:/home/ec2-user[root@ip-10-2-1-19 ec2-user]# ip link show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc mq state UP mode DEFAULT group default qlen 1000 link/ether 0a:6a:c2:7c:32:10 brd ff:ff:ff:ff:ff:ff 10-2-1-19:/home/ec2-user[root@ip-10-2-1-19 ec2-user]# Connection to ec2-52-211-163-20.eu-west-1.compute.amazonaws.com closed by remote host. Connection to ec2-52-211-163-20.eu-west-1.compute.amazonaws.com closed. |
$ls -l .ssh/
total 12 -rw-r--r-- 1 user user 175 Dec 18 12:59 config -rw-r--r-- 1 user user 1332 Dec 18 16:18 known_hosts -rw------- 1 user user 1696 Dec 18 12:49 user10.pem |
$ls -l ~/.ssh/
total 12 -rw-r--r-- 1 user user 175 Dec 18 12:59 config -rw-r--r-- 1 user user 1332 Dec 18 16:18 known_hosts -rw------- 1 user user 1696 Dec 18 12:49 user10.pem |
$sudo ls -l /root/.ssh/
[sudo] password for user: total 4 -rw-r--r-- 1 root root 391 Dec 16 12:43 authorized_keys |
$screen
|
$ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 30:85:a9:9e:10:aa brd ff:ff:ff:ff:ff:ff inet 172.20.13.183/25 brd 172.20.13.255 scope global dynamic enp3s0 valid_lft 689452sec preferred_lft 689452sec inet6 fe80::3285:a9ff:fe9e:10aa/64 scope link valid_lft forever preferred_lft forever |
$ssh ec2-34-244-157-202.eu-west-1.compute.amazonaws.com
Last login: Wed Dec 19 07:33:18 2018 from port-90-adslby-pool35.infonet.by __| __|_ ) _| ( / Amazon Linux 2 AMI ___|\___|___| https://aws.amazon.com/amazon-linux-2/ 15 package(s) needed for security, out of 16 available Run "sudo yum update" to apply all updates. @ip-10-2-1-85:~[ec2-user@ip-10-2-1-85 ~]$ @ip-10-2-1-85:~[ec2-user@ip-10-2-1-85 ~]$ @ip-10-2-1-85:~[ec2-user@ip-10-2-1-85 ~]$ ls -al ... -rw-r--r-- 1 ec2-user ec2-user 193 Jul 27 18:42 .bash_profile -rw-r--r-- 1 ec2-user ec2-user 231 Jul 27 18:42 .bashrc drwx------ 2 ec2-user ec2-user 29 Dec 19 07:28 .ssh @ip-10-2-1-85:~[ec2-user@ip-10-2-1-85 ~]$ cat ~/.ssh/authorized_keys ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQClAYBV26U6PGYnO1pfl5zvF3wHVufHXcsJkcZN10t6jkKVyLNyYPV5HdzT2ytDcuALY61KurzzOOha4totVugpyr3HNeiy1fxkoSoLUELYuMnya/tZBCgw4GOFb9QLhMXCsQ6NCnIpXqvbxkeRu4rTf2zYKDKE0/UQ3/mTm94AT/nm3V+3HReh5PGFqt6A2jeNiBMA2+8tKBYueEmQJjYIUkuuUGmI7TNo55wQB2sIWIBhR04xpY3VSwecClgTLqCkaYegZxbhOPNuvHDWehftqcNR1zF7RL1i3MMYhJL0yjr1K0xRbBHzwsvcMpGiDhAc0qr6EhKBKVOD8iERusFj user10 @ip-10-2-1-85:~[ec2-user@ip-10-2-1-85 ~]$ cat -n ~/.ssh/authorized_keys 1 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQClAYBV26U6PGYnO1pfl5zvF3wHVufHXcsJkcZN10t6jkKVyLNyYPV5HdzT2ytDcuALY61KurzzOOha4totVugpyr3HNeiy1fxkoSoLUELYuMnya/tZBCgw4GOFb9QLhMXCsQ6NCnIpXqvbxkeRu4rTf2zYKDKE0/UQ3/mTm94AT/nm3V+3HReh5PGFqt6A2jeNiBMA2+8tKBYueEmQJjYIUkuuUGmI7TNo55wQB2sIWIBhR04xpY3VSwecClgTLqCkaYegZxbhOPNuvHDWehftqcNR1zF7RL1i3MMYhJL0yjr1K0xRbBHzwsvcMpGiDhAc0qr6EhKBKVOD8iERusFj user10 @ip-10-2-1-85:~[ec2-user@ip-10-2-1-85 ~]$ exit logout Connection to ec2-34-244-157-202.eu-west-1.compute.amazonaws.com closed. |
$ssh-keygen
Generating public/private rsa key pair. Enter file in which to save the key (/home/user/.ssh/id_rsa): ssh Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in ssh. Your public key has been saved in ssh.pub. The key fingerprint is: SHA256:VCyKGdkZuQblSX5FyougNBL/Xo7d9cbdpqxIetFrUig user@instructor The key's randomart image is: +---[RSA 2048]----+ |. +++ o+ | | o +++o.+. | |. + .=+o=. | | o +o.++ . | | . ..o S .o | | . = .E.ooo. . | | o o ...o+.. o| | oooo. o | | ...o..o | +----[SHA256]-----+ |
$ls -l .ssh/
total 12 -rw-r--r-- 1 user user 175 Dec 18 12:59 config -rw-r--r-- 1 user user 1776 Dec 19 10:33 known_hosts -rw------- 1 user user 1696 Dec 18 12:49 user10.pem |
$ls -l ~/.ssh/
total 12 -rw-r--r-- 1 user user 175 Dec 18 12:59 config -rw-r--r-- 1 user user 1776 Dec 19 10:33 known_hosts -rw------- 1 user user 1696 Dec 18 12:49 user10.pem |
$ls
1.json Desktop github.txt Public ssh.pub aws Documents Music q- Templates credentials.csv Downloads Pictures ssh Videos |
$rm ssh ssh.pub
|
$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: SHA256:hdpMzlYQl2gvIZHuS3hxdBBZYnpqIKI2aE/A/rzVSek user@instructor The key's randomart image is: +---[RSA 2048]----+ | .oBBo. | |. oo*=o | |.o. ...+++o | |+... .oX+o. | |o= . o+=S. | |o * ..B.. | | + + E | | o . | | . | +----[SHA256]-----+ |
$cat /tmp/hosts
127.0.0.1 localhost te.ts.dev.exasol.com 127.0.1.1 hw2314 # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 172.20.13.183 m0 172.20.13.180 m1 172.20.13.187 m2 172.20.13.189 m3 172.20.13.186 m4 172.20.13.188 m5 172.20.13.190 m6 172.20.13.191 m7 172.20.13.192 m8 172.20.13.193 m9 |
$cat /etc/hosts
127.0.0.1 localhost 127.0.1.1 m1.class.sl m1 # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters 172.20.13.183 m0 172.20.13.180 m1 172.20.13.187 m2 172.20.13.189 m3 172.20.13.186 m4 172.20.13.188 m5 172.20.13.190 m6 172.20.13.191 m7 172.20.13.192 m8 172.20.13.193 m9 |
$ping m2
PING m2 (172.20.13.187) 56(84) bytes of data. 64 bytes from m2 (172.20.13.187): icmp_seq=1 ttl=64 time=0.083 ms ^C --- m2 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.083/0.083/0.083/0.000 ms |
$scp .ssh/id_rsa.pub m2:~/m0_id_rsa.pub
The authenticity of host 'm2 (172.20.13.187)' can't be established. ECDSA key fingerprint is SHA256:B9zpw0jYA+HubhfIpb0k6feDM2h8pMGnXhuSdJDCkRg. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'm2,172.20.13.187' (ECDSA) to the list of known hosts. user@m2's password: id_rsa.pub 100% 397 524.4KB/s 00:00 |
$ssh m2
user@m2's password: Linux m2 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 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. ls user@m2:~$ ls AWS Documents github.txt m0_id_rsa.pub Music Public Videos Desktop Downloads hello.md m3_id_rsa.pub Pictures Templates user@m2:~$ exit logout Connection to m2 closed. |
$ls .ssh/
config id_rsa id_rsa.pub known_hosts user10.pem |
$ssh m2
|
$ssh m1
user@m1's password: Linux instructor 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 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. Last login: Wed Dec 19 10:54:02 2018 from 172.20.13.189 l3-agent is already running: pid=962; pidfile=/home/user/.lilalo/l3-agent.pid user@instructor:~$ exit logout Connection to m1 closed. |
$sudo vim /etc/hosts
|
$ssh m1
user@m1's password: Linux instructor 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 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. Last login: Wed Dec 19 11:11:12 2018 from 127.0.0.1 l3-agent is already running: pid=962; pidfile=/home/user/.lilalo/l3-agent.pid user@instructor:~$ ... valid_lft forever preferred_lft forever 2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 30:85:a9:9e:10:aa brd ff:ff:ff:ff:ff:ff inet 172.20.13.183/25 brd 172.20.13.255 scope global dynamic enp3s0 valid_lft 687119sec preferred_lft 687119sec inet6 fe80::3285:a9ff:fe9e:10aa/64 scope link valid_lft forever preferred_lft forever user@instructor:~$ exit logout Connection to m1 closed. |
$sudo vim /etc/hosts
|
$scp .ssh/id_rsa.pub m1:~/m0_id_rsa.pub
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: POSSIBLE DNS SPOOFING DETECTED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ The ECDSA host key for m1 has changed, and the key for the corresponding IP address 172.20.13.180 is unknown. This could either mean that DNS SPOOFING is happening or the IP address for the host and its host key have changed at the same time. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ ... The fingerprint for the ECDSA key sent by the remote host is SHA256:jx2YBdjhFE8f40NqCGSRZ1ZaKImHeR0PdtDd89rugeQ. Please contact your system administrator. Add correct host key in /home/user/.ssh/known_hosts to get rid of this message. Offending ECDSA key in /home/user/.ssh/known_hosts:11 remove with: ssh-keygen -f "/home/user/.ssh/known_hosts" -R m1 ECDSA host key for m1 has changed and you have requested strict checking. Host key verification failed. lost connection |
$ssh-keygen -R m1
# Host m1 found: line 11 /home/user/.ssh/known_hosts updated. Original contents retained as /home/user/.ssh/known_hosts.old |
$scp .ssh/id_rsa.pub m1:~/m0_id_rsa.pub
The authenticity of host 'm1 (172.20.13.180)' can't be established. ECDSA key fingerprint is SHA256:jx2YBdjhFE8f40NqCGSRZ1ZaKImHeR0PdtDd89rugeQ. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'm1,172.20.13.180' (ECDSA) to the list of known hosts. user@m1's password: id_rsa.pub 100% 397 159.8KB/s 00:00 |
$cat .ssh/config
Host *.compute.amazonaws.com IdentityFile ~/.ssh/user10.pem User ec2-user # ssh -i ~/.ssh/user10.pem ec2-user@XXXX.compute.amazonaws.com # ssh XXXX.compute.amazonaws.com |
$ssh-add -l
2048 SHA256:hdpMzlYQl2gvIZHuS3hxdBBZYnpqIKI2aE/A/rzVSek user@instructor (RSA) |
$ssh-add .ssh/
config id_rsa.pub known_hosts.old id_rsa known_hosts user10.pem |
$ssh-add .ssh/user10.pem
Identity added: .ssh/user10.pem (.ssh/user10.pem) |
$ssh-add -l
2048 SHA256:RPIwbMhpaMbQog9dUP3ZL1CwJcqCzEqcVQ3e3tjItXU .ssh/user10.pem (RSA) 2048 SHA256:hdpMzlYQl2gvIZHuS3hxdBBZYnpqIKI2aE/A/rzVSek user@instructor (RSA) |
$export | grep SSH
declare -x SSH_AGENT_PID="1197" declare -x SSH_AUTH_SOCK="/run/user/1001/keyring/ssh" |
$bash
bash: warning: command substitution: ignored null byte in input |
$unset SSH_AGENT_PID
|
$export | grep SSH
declare -x SSH_AGENT_PID="1197" declare -x SSH_AUTH_SOCK="/run/user/1001/keyring/ssh" |
$ssh ec2-34-244-157-202.eu-west-1.compute.amazonaws.com
@ip-10-2-1-85:~[ec2-user@ip-10-2-1-85 ~]$ # touch .hushlogin @ip-10-2-1-85:~[ec2-user@ip-10-2-1-85 ~]$ export | grep SSH declare -x SSH_CLIENT="81.25.35.90 11097 22" declare -x SSH_CONNECTION="81.25.35.90 11097 10.2.1.85 22" declare -x SSH_TTY="/dev/pts/0" @ip-10-2-1-85:~[ec2-user@ip-10-2-1-85 ~]$ exit logout Connection to ec2-34-244-157-202.eu-west-1.compute.amazonaws.com closed. |
$vim ~/.ssh/config
|
$ssh ec2-34-245-119-80.eu-west-1.compute.amazonaws.com
ssh: connect to host ec2-34-245-119-80.eu-west-1.compute.amazonaws.com port 22: Connection refused |
$ssh ec2-34-245-119-80.eu-west-1.compute.amazonaws.com
ssh: connect to host ec2-34-245-119-80.eu-west-1.compute.amazonaws.com port 22: Connection refused |
$ssh ec2-34-245-119-80.eu-west-1.compute.amazonaws.com
The authenticity of host 'ec2-34-245-119-80.eu-west-1.compute.amazonaws.com (34.245.119.80)' can't be established. ECDSA key fingerprint is SHA256:5n+/43Yvo/VS8MELz5gOQaZtby1xb/m/tr5fhw3LDmQ. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'ec2-34-245-119-80.eu-west-1.compute.amazonaws.com,34.245.119.80' (ECDSA) to the list of known hosts. __| __|_ ) _| ( / Amazon Linux 2 AMI ___|\___|___| https://aws.amazon.com/amazon-linux-2/ @ip-10-2-1-62:~[ec2-user@ip-10-2-1-62 ~]$ ls .ssh/ authorized_keys @ip-10-2-1-62:~[ec2-user@ip-10-2-1-62 ~]$ mv .ssh/authorized_keys{,_} @ip-10-2-1-62:~[ec2-user@ip-10-2-1-62 ~]$ ls .ssh/ authorized_keys_ @ip-10-2-1-62:~[ec2-user@ip-10-2-1-62 ~]$ exit logout Connection to ec2-34-245-119-80.eu-west-1.compute.amazonaws.com closed. |
$ssh ec2-34-245-119-80.eu-west-1.compute.amazonaws.com
Permission denied (publickey,gssapi-keyex,gssapi-with-mic). |
$ssh ec2-34-244-157-202.eu-west-1.compute.amazonaws.com
@ip-10-2-1-85:~[ec2-user@ip-10-2-1-85 ~]$ sudo -s 10-2-1-85:/home/ec2-user[root@ip-10-2-1-85 ec2-user]# dmesg | tail [ 5.077891] EDAC sbridge: Seeking for: PCI ID 8086:2fa0 [ 5.077894] EDAC sbridge: Ver: 1.1.2 [ 5.362463] RPC: Registered named UNIX socket transport module. [ 5.362464] RPC: Registered udp transport module. [ 5.362464] RPC: Registered tcp transport module. [ 5.362465] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 5.585736] random: crng init done [ 5.588597] random: 7 urandom warning(s) missed due to ratelimiting ... boot etc lib local mnt proc run srv tmp var 10-2-1-85:/home/ec2-user[root@ip-10-2-1-85 ec2-user]# ls /mnt/home/user/.ss ls: cannot access /mnt/home/user/.ss: No such file or directory 10-2-1-85:/home/ec2-user[root@ip-10-2-1-85 ec2-user]# ls /mnt/home/ec2-user 10-2-1-85:/home/ec2-user[root@ip-10-2-1-85 ec2-user]# ls /mnt/home/ec2-user/.ssh authorized_keys_ ome/ec2-user/.ssh/authorized_keys_ nt/home/ec2-user/.ssh/authorized_keys{_,} nt/ho 10-2-1-85:/home/ec2-user[root@ip-10-2-1-85 ec2-user]# umount /mnt 10-2-1-85:/home/ec2-user[root@ip-10-2-1-85 ec2-user]# Connection to ec2-34-244-157-202.eu-west-1.compute.amazonaws.com closed by remote host. Connection to ec2-34-244-157-202.eu-west-1.compute.amazonaws.com closed. |
$ssh ec2-34-244-157-202.eu-west-1.compute.amazonaws.com
^C |
$ssh ec2-34-244-73-108.eu-west-1.compute.amazonaws.com
Last login: Wed Dec 19 09:47:22 2018 from port-90-adslby-pool35.infonet.by __| __|_ ) _| ( / Amazon Linux 2 AMI ___|\___|___| https://aws.amazon.com/amazon-linux-2/ 15 package(s) needed for security, out of 16 available Run "sudo yum update" to apply all updates. @ip-10-2-1-62:~[ec2-user@ip-10-2-1-62 ~]$ @ip-10-2-1-62:~[ec2-user@ip-10-2-1-62 ~]$ @ip-10-2-1-62:~[ec2-user@ip-10-2-1-62 ~]$ @ip-10-2-1-62:~[ec2-user@ip-10-2-1-62 ~]$ @ip-10-2-1-62:~[ec2-user@ip-10-2-1-62 ~]$ Connection to ec2-34-244-73-108.eu-west-1.compute.amazonaws.com closed. |
$ssh ec2-34-244-73-108.eu-west-1.compute.amazonaws.com
Last login: Wed Dec 19 11:08:06 2018 from port-90-adslby-pool35.infonet.by __| __|_ ) _| ( / Amazon Linux 2 AMI ___|\___|___| https://aws.amazon.com/amazon-linux-2/ 15 package(s) needed for security, out of 16 available Run "sudo yum update" to apply all updates. @ip-10-2-1-62:~[ec2-user@ip-10-2-1-62 ~]$ ~^Z [suspend ssh] [1]+ Stopped ssh ec2-34-244-73-108.eu-west-1.compute.amazonaws.com |
$man ssh
|
$2
@ip-10-2-1-85:~[ec2-user@ip-10-2-1-85 ~]$ exit logout Connection to 10.2.1.85 closed. Connection to ec2-34-244-73-108.eu-west-1.compute.amazonaws.com closed. |
$vim ~/.bashrc
|
$sudo pip^C
|
$apt-cache search awscli
awscli - Universal Command Line Environment for AWS |
$apt-cache show awscli
Package: awscli Version: 1.11.13-1 Installed-Size: 2831 Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org> Architecture: all Depends: python3, python3-botocore (>= 1.3.9), python3-colorama, python3-docutils, python3-rsa, python3-s3transfer, python3:any (>= 3.3.2-2~) Description-en: Universal Command Line Environment for AWS This package provides a unified command line interface to many Amazon Web Services. . ... * Auto Scaling * Elastic Load Balancing Description-md5: aaf8e6b3ff4426c8a7b4d7d49df6ee53 Homepage: http://aws.amazon.com/cli/ Section: admin Priority: optional Filename: pool/main/a/awscli/awscli_1.11.13-1_all.deb Size: 403388 MD5sum: d212d89fd9effd33e8a69d322203dd08 SHA256: b74e6665f792865dee044b634c62ffc1c697f2e908f71089b301426942fc9104 |
$ 2
|
$ 2
apt-cache show awscli Package: awscli Version: 1.11.13-1 Installed-Size: 2831 Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org> Architecture: all Depends: python3, python3-botocore (>= 1.3.9), python3-colorama, python3-docutils, python3-rsa, python3-s3transfer, python3:any (>= 3.3.2-2~) Description-en: Universal Command Line Environment for AWS This package provides a unified command line interface to many Amazon Web Services. ... * Auto Scaling * Elastic Load Balancing Description-md5: aaf8e6b3ff4426c8a7b4d7d49df6ee53 Homepage: http://aws.amazon.com/cli/ Section: admin Priority: optional Filename: pool/main/a/awscli/awscli_1.11.13-1_all.deb Size: 403388 MD5sum: d212d89fd9effd33e8a69d322203dd08 SHA256: b74e6665f792865dee044b634c62ffc1c697f2e908f71089b301426942fc9104 |
$apt-cache show awscli
Package: awscli Version: 1.11.13-1 Installed-Size: 2831 Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org> Architecture: all Depends: python3, python3-botocore (>= 1.3.9), python3-colorama, python3-docutils, python3-rsa, python3-s3transfer, python3:any (>= 3.3.2-2~) Description-en: Universal Command Line Environment for AWS This package provides a unified command line interface to many Amazon Web Services. . ... * Auto Scaling * Elastic Load Balancing Description-md5: aaf8e6b3ff4426c8a7b4d7d49df6ee53 Homepage: http://aws.amazon.com/cli/ Section: admin Priority: optional Filename: pool/main/a/awscli/awscli_1.11.13-1_all.deb Size: 403388 MD5sum: d212d89fd9effd33e8a69d322203dd08 SHA256: b74e6665f792865dee044b634c62ffc1c697f2e908f71089b301426942fc9104 |
$apt-cache search pip
aeolus - Synthesised pipe organ emulator aespipe - AES-encryption tool with loop-AES support algol68g - Implementation of Algol 68 as defined by the Revised Report amavisd-new - Interface between MTA and virus scanner/content filters ampr-ripd - Routing daemon for AMPRnet gateway announcements amule-gnome-support - ed2k links handling support for GNOME web browsers libapksig-java - library to sign and verify Android APKs apertium-lex-tools - Constraint-based lexical selection module python-apipkg - namespace control and lazy-import mechanism for Python python3-apipkg - namespace control and lazy-import mechanism for Python 3 ... weechat-curses - Fast, light and extensible chat client - console client weechat-plugins - Fast, light and extensible chat client - plugins weightwatcher - Combine maps and polygon data for astronomical image processing python-wheel - built-package format for Python python-wheel-common - built-package format for Python python3-wheel - built-package format for Python xml2 - Convert between XML, HTML, CSV and a line-oriented format xplot - simple on-screen x-y column data plotter xscreensaver-gl - GL(Mesa) screen saver modules for screensaver frontends yample - Yet Another Mail Processing Language |
$apt-cache search python pip
python-apipkg - namespace control and lazy-import mechanism for Python python3-apipkg - namespace control and lazy-import mechanism for Python 3 libassimp3v5 - 3D model import library python-pyassimp - 3D model import library (Python bindings) python-calabash - Bash-style pipelining syntax for Python generators dirtbike - turn system-installed Python packages into wheels python-django-pipeline - Asset packaging library for Django python-django-pipeline-doc - Documentation for Django Pipeline library python3-django-pipeline - Asset packaging library for Django (Python3 version) python-easyprocess - easy to use python subprocess interface - Python 2.X ... pypy-wand - Python interface for ImageMagick library (PyPy build) python-wand - Python interface for ImageMagick library (Python 2 build) python3-wand - Python interface for ImageMagick library (Python 3 build) wand-doc - Python interface for ImageMagick library - documentation weechat - Fast, light and extensible chat client weechat-curses - Fast, light and extensible chat client - console client weechat-plugins - Fast, light and extensible chat client - plugins python-wheel - built-package format for Python python-wheel-common - built-package format for Python python3-wheel - built-package format for Python |
$apt-cache search python pip | grep python
python-apipkg - namespace control and lazy-import mechanism for Python python3-apipkg - namespace control and lazy-import mechanism for Python 3 python-pyassimp - 3D model import library (Python bindings) python-calabash - Bash-style pipelining syntax for Python generators python-django-pipeline - Asset packaging library for Django python-django-pipeline-doc - Documentation for Django Pipeline library python3-django-pipeline - Asset packaging library for Django (Python3 version) python-easyprocess - easy to use python subprocess interface - Python 2.X python3-easyprocess - easy to use python subprocess interface - Python 3.X python-joblib - tools to provide lightweight pipelining in Python ... python-ruffus - Python computation pipeline library widely used in bioinformatics python-ruffus-doc - documentation for python-ruffus computation pipeline library python3-ruffus - Python3 computation pipeline library widely used in bioinformatics pythonpy - 'python -c', with tab completion and shorthand python-sclapp - framework for Python command-line applications python-wand - Python interface for ImageMagick library (Python 2 build) python3-wand - Python interface for ImageMagick library (Python 3 build) python-wheel - built-package format for Python python-wheel-common - built-package format for Python python3-wheel - built-package format for Python |
Host *.compute.amazonaws.com IdentityFile ~/.ssh/user10.pem User ec2-user # ssh -i ~/.ssh/user10.pem ec2-user@XXXX.compute.amazonaws.com # ssh XXXX.compute.amazonaws.com
127.0.0.1 localhost 127.0.1.1 m1.class.sl m1 # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters 172.20.13.183 m0 172.20.13.180 m1 172.20.13.187 m2 172.20.13.189 m3 172.20.13.186 m4 172.20.13.188 m5 172.20.13.190 m6 172.20.13.191 m7 172.20.13.192 m8 172.20.13.193 m9
127.0.0.1 localhost te.ts.dev.exasol.com 127.0.1.1 hw2314 # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters 172.20.13.183 m0 172.20.13.180 m1 172.20.13.187 m2 172.20.13.189 m3 172.20.13.186 m4 172.20.13.188 m5 172.20.13.190 m6 172.20.13.191 m7 172.20.13.192 m8 172.20.13.193 m9
user10,XXXXXXUr)8qx,XXXXXX5YKZDPMPLU7NMA,XXXXXXXXi2nOUIKxfRV1/ETIM2/EUR7Ks1Hr1QJ+,https://chubin.signin.aws.amazon.com/console
Host *.compute.amazonaws.com IdentityFile ~/.ssh/user10.pem User ec2-user # ssh -i ~/.ssh/user10.pem ec2-user@XXXX.compute.amazonaws.com # ssh XXXX.compute.amazonaws.com
Время первой команды журнала | 14:27:28 2018-12-17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 12:17:30 2018-12-19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 18.81 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 3.52 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.48 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду w. В поле WHAT, соответствующем текущему терминалу, должна быть указана программа script.
Команды, при наборе которых были допущены синтаксические ошибки, выводятся перечёркнутым текстом:
$ l s-l bash: l: command not found |
Если код завершения команды равен нулю, команда была выполнена без ошибок. Команды, код завершения которых отличен от нуля, выделяются цветом.
$ test 5 -lt 4 |
Команды, ход выполнения которых был прерван пользователем, выделяются цветом.
$ find / -name abc find: /home/devi-orig/.gnome2: Keine Berechtigung find: /home/devi-orig/.gnome2_private: Keine Berechtigung find: /home/devi-orig/.nautilus/metafiles: Keine Berechtigung find: /home/devi-orig/.metacity: Keine Berechtigung find: /home/devi-orig/.inkscape: Keine Berechtigung ^C |
Команды, выполненные с привилегиями суперпользователя, выделяются слева красной чертой.
# id uid=0(root) gid=0(root) Gruppen=0(root) |
Изменения, внесённые в текстовый файл с помощью редактора, запоминаются и показываются в журнале в формате ed. Строки, начинающиеся символом "<", удалены, а строки, начинающиеся символом ">" -- добавлены.
$ vi ~/.bashrc
|
Для того чтобы изменить файл в соответствии с показанными в диффшоте изменениями, можно воспользоваться командой patch. Нужно скопировать изменения, запустить программу patch, указав в качестве её аргумента файл, к которому применяются изменения, и всавить скопированный текст:
$ patch ~/.bashrc |
Для того чтобы получить краткую справочную информацию о команде, нужно подвести к ней мышь. Во всплывающей подсказке появится краткое описание команды.
Если справочная информация о команде есть, команда выделяется голубым фоном, например: vi. Если справочная информация отсутствует, команда выделяется розовым фоном, например: notepad.exe. Справочная информация может отсутствовать в том случае, если (1) команда введена неверно; (2) если распознавание команды LiLaLo выполнено неверно; (3) если информация о команде неизвестна LiLaLo. Последнее возможно для редких команд.
Большие, в особенности многострочные, всплывающие подсказки лучше всего показываются браузерами KDE Konqueror, Apple Safari и Microsoft Internet Explorer. В браузерах Mozilla и Firefox они отображаются не полностью, а вместо перевода строки выводится специальный символ.
Время ввода команды, показанное в журнале, соответствует времени начала ввода командной строки, которое равно тому моменту, когда на терминале появилось приглашение интерпретатора
Имя терминала, на котором была введена команда, показано в специальном блоке. Этот блок показывается только в том случае, если терминал текущей команды отличается от терминала предыдущей.
Вывод не интересующих вас в настоящий момент элементов журнала, таких как время, имя терминала и других, можно отключить. Для этого нужно воспользоваться формой управления журналом вверху страницы.
Небольшие комментарии к командам можно вставлять прямо из командной строки. Комментарий вводится прямо в командную строку, после символов #^ или #v. Символы ^ и v показывают направление выбора команды, к которой относится комментарий: ^ - к предыдущей, v - к следующей. Например, если в командной строке было введено:
$ whoami
user
$ #^ Интересно, кто я?в журнале это будет выглядеть так:
$ whoami
user
Интересно, кто я? |
Если комментарий содержит несколько строк, его можно вставить в журнал следующим образом:
$ whoami
user
$ cat > /dev/null #^ Интересно, кто я?
Программа whoami выводит имя пользователя, под которым мы зарегистрировались в системе. - Она не может ответить на вопрос о нашем назначении в этом мире.В журнале это будет выглядеть так:
$ whoami user
|
Комментарии, не относящиеся непосредственно ни к какой из команд, добавляются точно таким же способом, только вместо симолов #^ или #v нужно использовать символы #=
1 2 3 4Группы команд, выполненных на разных терминалах, разделяются специальной линией. Под этой линией в правом углу показано имя терминала, на котором выполнялись команды. Для того чтобы посмотреть команды только одного сенса, нужно щёкнуть по этому названию.
LiLaLo (L3) расшифровывается как Live Lab Log.
Программа разработана для повышения эффективности обучения Unix/Linux-системам.
(c) Игорь Чубин, 2004-2008