/l3/users/slm/2018-12-minsk-aws/student03.BigClassRoom/user :1 :2 :3 :4 :5 :6 :7 |
|
$git add -p
diff --git a/hello.md b/hello.md index f100f03..e1e96ce 100644 --- a/hello.md +++ b/hello.md @@ -1,3 +1,7 @@ +## Introduction + +Introduction + ## Hello Hello *Tatiana* Stage this hunk [y,n,q,a,d,/,e,?]? y |
$git commit -m 'add new Text'
[master 4750fbe] add new Text Committer: ValeryBarai <user@m3.class.sl> Your name and email address were configured automatically based on your username and hostname. Please check that they are accurate. You can suppress this message by setting them explicitly: git config --global user.name "Your Name" git config --global user.email you@example.com After doing this, you may fix the identity used for this commit with: git commit --amend --reset-author 1 file changed, 4 insertions(+) |
$git status
On branch master Your branch is ahead of 'origin/master' by 2 commits. (use "git push" to publish your local commits) nothing to commit, working tree clean |
$git push
Username for 'https://github.com': ValeryBarai Password for 'https://ValeryBarai@github.com': Counting objects: 6, done. Delta compression using up to 4 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (6/6), 549 bytes | 0 bytes/s, done. Total 6 (delta 0), reused 0 (delta 0) To https://github.com/ValeryBarai/AWS.git 850da4a..4750fbe master -> master |
$ssh 172.20.13.183
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 | [user@instructor:~]$ [user@instructor:~]$ [user@instructor:~]$ [user@instructor:~]$ # www.yasiv.com/github/ |
$history
1 more /proc/cpuinfo 2 more /proc/cpuinfo | grep vmx 3 free 4 free -m 5 uname -a 6 lspci 7 su - 8 vi /etc/sudoers 9 su 10 sudo dmidecode ... 105 git add -p 106 git commit -m 'add new Text' 107 git status 108 git push 109 git add -p 110 git status 111 exit 112 ssh 172.20.13.183 113 hist 114 history |
$git status
fatal: Not a git repository (or any of the parent directories): .git |
$git status
fatal: Not a git repository (or any of the parent directories): .git |
$pwd
/home/user |
$sudo git status
[sudo] password for user: fatal: Not a git repository (or any of the parent directories): .git |
$sudo apt-get install git-core
Reading package lists... Done Building dependency tree Reading state information... Done git-core is already the newest version (1:2.11.0-3+deb9u4). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. |
$ls -la
total 120 drwxr-xr-x 18 user user 4096 Dec 18 10:20 . drwxr-xr-x 4 root root 4096 Dec 16 14:01 .. drwxr-xr-x 3 user user 4096 Dec 17 16:45 AWS -rw------- 1 user user 2939 Dec 17 17:05 .bash_history -rw-r--r-- 1 user user 220 May 15 2017 .bash_logout -rw-r--r-- 1 user root 10 Dec 16 14:23 .bash_profile -rw-r--r-- 1 user user 636 Dec 17 12:41 .bashrc drwx------ 8 user user 4096 Dec 17 15:13 .cache drwx------ 9 user user 4096 Dec 17 12:15 .config ... drwx------ 5 user user 4096 Dec 17 12:18 .mozilla drwxr-xr-x 2 user user 4096 Dec 17 12:15 Music drwxr-xr-x 2 user user 4096 Dec 17 12:15 Pictures -rw-r--r-- 1 user user 675 May 15 2017 .profile drwxr-xr-x 2 user user 4096 Dec 17 12:15 Public drwx------ 2 user user 4096 Dec 17 12:23 .ssh drwxr-xr-x 2 user user 4096 Dec 17 12:15 Templates drwxr-xr-x 2 user user 4096 Dec 17 12:15 Videos -rw------- 1 user user 6894 Dec 17 16:45 .viminfo -rw-r--r-- 1 user user 103 Dec 17 14:43 V.json |
$cd AWS/
|
$git sta
git: 'sta' is not a git command. See 'git --help'. Did you mean one of these? status stage stash |
$git status
On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working tree clean |
$ls -la
total 16 drwxr-xr-x 3 user user 4096 Dec 17 16:45 . drwxr-xr-x 18 user user 4096 Dec 18 10:20 .. drwxr-xr-x 8 user user 4096 Dec 18 10:30 .git -rw-r--r-- 1 user user 88 Dec 17 16:45 hello.md |
$git diff
|
$curl wttr.in?3n
Weather report: Minsk, Belarus _`/"".-. Light Snow Shower, Mist ,\_( ). -11--6 °C /(___(__) ↖ 11 km/h * * * 3 km * * * 0.6 mm ┌─────────────┐ ┌───────────────────────┤ Tue 18 Dec ├───────────────────────┐ │ Noon └──────┬──────┘ Night │ ├──────────────────────────────┼──────────────────────────────┤ ... ┌───────────────────────┤ Thu 20 Dec ├───────────────────────┐ │ Noon └──────┬──────┘ Night │ ├──────────────────────────────┼──────────────────────────────┤ │ _`/"".-. Light snow │ Overcast │ │ ,\_( ). -17--11 °C │ .--. -16 °C │ │ /(___(__) ↖ 12-17 km/h │ .-( ). ↖ 13-20 km/h │ │ * * * 20 km │ (___.__)__) 20 km │ │ * * * 0.0 mm | 0% │ 0.0 mm | 0% │ └──────────────────────────────┴──────────────────────────────┘ Follow @igor_chubin for wttr.in updates |
$cd ..
|
$ls -la
total 120 drwxr-xr-x 18 user user 4096 Dec 18 10:20 . drwxr-xr-x 4 root root 4096 Dec 16 14:01 .. drwxr-xr-x 3 user user 4096 Dec 17 16:45 AWS -rw------- 1 user user 2939 Dec 17 17:05 .bash_history -rw-r--r-- 1 user user 220 May 15 2017 .bash_logout -rw-r--r-- 1 user root 10 Dec 16 14:23 .bash_profile -rw-r--r-- 1 user user 636 Dec 17 12:41 .bashrc drwx------ 8 user user 4096 Dec 17 15:13 .cache drwx------ 9 user user 4096 Dec 17 12:15 .config ... drwx------ 5 user user 4096 Dec 17 12:18 .mozilla drwxr-xr-x 2 user user 4096 Dec 17 12:15 Music drwxr-xr-x 2 user user 4096 Dec 17 12:15 Pictures -rw-r--r-- 1 user user 675 May 15 2017 .profile drwxr-xr-x 2 user user 4096 Dec 17 12:15 Public drwx------ 2 user user 4096 Dec 17 12:23 .ssh drwxr-xr-x 2 user user 4096 Dec 17 12:15 Templates drwxr-xr-x 2 user user 4096 Dec 17 12:15 Videos -rw------- 1 user user 6894 Dec 17 16:45 .viminfo -rw-r--r-- 1 user user 103 Dec 17 14:43 V.json |
$ls -ls | grep cre
|
$ls -la | grep C
-rw------- 1 user user 596 Dec 18 10:20 .ICEauthority |
$su -
Password: Removing stale pidfile root@m3:~# pwd /root root@m3:~# ls -la | grep cre -rw-r--r-- 1 root root 127 Dec 16 14:41 credentials.csv root@m3:~# more credentials.csv user3,nXcLgqp@w{=v,AKIAICURZPV5ZJ3CXGDA,r8qVLcjn01LIb6/4e0RJd0ZAWbFmVgaQz2ubgl32,https://chubin.signin.aws.amazon.com/console root@m3:~# cat credentials.csv | tr , '\n' user3 nXcLgqp@w{=v AKIAICURZPV5ZJ3CXGDA r8qVLcjn01LIb6/4e0RJd0ZAWbFmVgaQz2ubgl32 https://chubin.signin.aws.amazon.com/console root@m3:~# apt-get search chrome E: Invalid operation search root@m3:~# logout |
$history | grep sear
134 history | sear 135 history | grep sear |
$history | grep apt-get
20 sudo apt-get install bonnie++ 29 sudo apt-get install curl 43 sudo apt-get install jq 59 sudo apt-get install git-core 119 history | grep apt-get 120 sudo apt-get install git-core 136 history | grep apt-get |
$sudo apt-get install chrome
[sudo] password for user: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package chrome |
$dpkg -i google-chrome-stable_current_amd64.deb
dpkg: error: requested operation requires superuser privilege |
$google-chrome
bash: google-chrome: command not found |
$dpkg -i libappindicator3-1_0.4.92-4_amd64.deb
dpkg: error: requested operation requires superuser privilege |
$cd Downloads/
|
$sudo dpkg -i gir1.2-dbusmenu-glib-0.4_12.10.2-2_amd64.deb
[sudo] password for user: Selecting previously unselected package gir1.2-dbusmenu-glib-0.4. (Reading database ... 137034 files and directories currently installed.) Preparing to unpack gir1.2-dbusmenu-glib-0.4_12.10.2-2_amd64.deb ... Unpacking gir1.2-dbusmenu-glib-0.4 (12.10.2-2) ... dpkg: dependency problems prevent configuration of gir1.2-dbusmenu-glib-0.4: gir1.2-dbusmenu-glib-0.4 depends on libdbusmenu-glib4 (= 12.10.2-2); however: Package libdbusmenu-glib4 is not installed. dpkg: error processing package gir1.2-dbusmenu-glib-0.4 (--install): dependency problems - leaving unconfigured Errors were encountered while processing: gir1.2-dbusmenu-glib-0.4 |
$sudo dpkg -i
gir1.2-dbusmenu-glib-0.4_12.10.2-2_amd64.deb libdbusmenu-glib4_18.10.20180917~bzr490+repack1-1_amd64.deb |
$sudo dpkg -i libdbusmenu-glib4_18.10.20180917~bzr490+repack1-1_amd64.deb
Selecting previously unselected package libdbusmenu-glib4:amd64. (Reading database ... 137042 files and directories currently installed.) Preparing to unpack libdbusmenu-glib4_18.10.20180917~bzr490+repack1-1_amd64.deb ... Unpacking libdbusmenu-glib4:amd64 (18.10.20180917~bzr490+repack1-1) ... Setting up libdbusmenu-glib4:amd64 (18.10.20180917~bzr490+repack1-1) ... Processing triggers for libc-bin (2.24-11+deb9u3) ... |
$cd Downloads/
|
$sudo dpkg -i libdbusmenu-g
libdbusmenu-glib4_18.10.20180917~bzr490+repack1-1_amd64.deb libdbusmenu-gtk3-4_12.10.2-2_amd64.deb |
$sudo dpkg -i libdbusmenu-gtk3-4_12.10.2-2_amd64.deb
Selecting previously unselected package libdbusmenu-gtk3-4:amd64. (Reading database ... 137047 files and directories currently installed.) Preparing to unpack libdbusmenu-gtk3-4_12.10.2-2_amd64.deb ... Unpacking libdbusmenu-gtk3-4:amd64 (12.10.2-2) ... Setting up libdbusmenu-gtk3-4:amd64 (12.10.2-2) ... Processing triggers for libc-bin (2.24-11+deb9u3) ... |
$cd ..
|
$cd Downloads/
|
$sudo dpkg -i libindicator3-7_0.5.0-3+b1_amd64.deb
Selecting previously unselected package libindicator3-7:amd64. (Reading database ... 137056 files and directories currently installed.) Preparing to unpack libindicator3-7_0.5.0-3+b1_amd64.deb ... Unpacking libindicator3-7:amd64 (0.5.0-3+b1) ... Setting up libindicator3-7:amd64 (0.5.0-3+b1) ... Processing triggers for libc-bin (2.24-11+deb9u3) ... |
$cd ..
|
$chr
chrome-gnome-shell chrt |
$google-chrome
Fontconfig warning: "/etc/fonts/fonts.conf", line 100: unknown element "blank" ATTENTION: default value of option force_s3tc_enable overridden by environment. [3900:3900:1218/114734.445308:ERROR:x11_input_method_context_impl_gtk.cc(144)] Not implemented reached in virtual void libgtkui::X11InputMethodContextImplGtk::SetSurroundingText(const base::string16 &, const gfx::Range &) [3900:3900:1218/114740.848129:ERROR:CONSOLE(1)] "Not allowed to load local resource: chrome-search://local-ntp/theme.css", source: https://www.google.com/_/chrome/newtab?ie=UTF-8 (1) [3900:3900:1218/121606.573716:ERROR:textfield.cc(1777)] Not implemented reached in virtual bool views::Textfield::ShouldDoLearning() |
$ls -la
total 55524 drwxr-xr-x 20 user user 4096 Dec 18 11:47 . drwxr-xr-x 4 root root 4096 Dec 16 14:01 .. drwxr-xr-x 3 user user 4096 Dec 17 16:45 AWS -rw------- 1 user user 2939 Dec 17 17:05 .bash_history -rw-r--r-- 1 user user 220 May 15 2017 .bash_logout -rw-r--r-- 1 user root 10 Dec 16 14:23 .bash_profile -rw-r--r-- 1 user user 636 Dec 17 12:41 .bashrc drwx------ 9 user user 4096 Dec 18 11:47 .cache drwx------ 12 user user 4096 Dec 18 11:47 .config ... drwxr-xr-x 2 user user 4096 Dec 17 12:15 Music drwxr-xr-x 2 user user 4096 Dec 17 12:15 Pictures drwx------ 3 user user 4096 Dec 18 11:47 .pki -rw-r--r-- 1 user user 675 May 15 2017 .profile drwxr-xr-x 2 user user 4096 Dec 17 12:15 Public drwx------ 2 user user 4096 Dec 17 12:23 .ssh drwxr-xr-x 2 user user 4096 Dec 17 12:15 Templates drwxr-xr-x 2 user user 4096 Dec 17 12:15 Videos -rw------- 1 user user 6894 Dec 17 16:45 .viminfo -rw-r--r-- 1 user user 103 Dec 17 14:43 V.json |
$cd .ssh/
|
$mv ~/Downloads/user3.pem ~/ssh/
mv: cannot move '/home/user/Downloads/user3.pem' to '/home/user/ssh/': Not a directory |
$mv ~/Downloads/user3.pem ~/.ssh/
|
$ls -la
total 16 drwx------ 2 user user 4096 Dec 18 12:52 . drwxr-xr-x 20 user user 4096 Dec 18 11:47 .. -rw-r--r-- 1 user user 222 Dec 17 12:23 known_hosts -rw-r--r-- 1 user user 1692 Dec 18 12:49 user3.pem |
$more user3.pem
|
$touch config
|
$vi config
|
$more config
|
$pwd
/home/user/.ssh |
$vi config
|
$cat config
Host *.compute.amazonaws.com IdentityFile ~/.ssh/user3.pem User ec2-user # ssh -i ~/.ssh/user3 ec2-user@XXXX.compute.amazonaws.com # ssh XXXX.compute.amazonaws.com |
$ssh 18.202.236.151
^C |
$ssh 18.202.236.151
^C |
$ssh 18.202.236.151
^C |
$ssh 34.244.173.136
The authenticity of host '34.244.173.136 (34.244.173.136)' can't be established. ECDSA key fingerprint is SHA256:j5DwZ2NTVudryOYSEkHUEdwr2MODsLZveIwydtu1GpI. Are you sure you want to continue connecting (yes/no)? n Please type 'yes' or 'no': n Please type 'yes' or 'no': no Host key verification failed. |
$ssh 18.244.173.136
^C |
$cd .ssh/
|
$ls -la
total 20 drwx------ 2 user user 4096 Dec 18 12:59 . drwxr-xr-x 20 user user 4096 Dec 18 12:59 .. -rw-r--r-- 1 user user 167 Dec 18 12:59 config -rw-r--r-- 1 user user 222 Dec 17 12:23 known_hosts -rw-r--r-- 1 user user 1692 Dec 18 12:49 user3.pem |
$more user3.pem
|
$ssh 18.202.236.151
^C |
$ssh 18.202.236.151
The authenticity of host '18.202.236.151 (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)? yes Warning: Permanently added '18.202.236.151' (ECDSA) to the list of known hosts. Permission denied (publickey,gssapi-keyex,gssapi-with-mic). |
$chmod 600
config known_hosts user3.pem |
$chmod 600 user3.pem
|
$ls -la
total 20 drwx------ 2 user user 4096 Dec 18 12:59 . drwxr-xr-x 20 user user 4096 Dec 18 12:59 .. -rw-r--r-- 1 user user 167 Dec 18 12:59 config -rw-r--r-- 1 user user 444 Dec 18 15:23 known_hosts -rw------- 1 user user 1692 Dec 18 12:49 user3.pem |
$sudo ssh 18.202.236.151
[sudo] password for user: The authenticity of host '18.202.236.151 (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)? y Please type 'yes' or 'no': yes Warning: Permanently added '18.202.236.151' (ECDSA) to the list of known hosts. Permission denied (publickey,gssapi-keyex,gssapi-with-mic). |
$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)? y Please type 'yes' or 'no': yes Warning: Permanently added 'ec2-18-202-236-151.eu-west-1.compute.amazonaws.com' (ECDSA) to the list of known hosts. __| __|_ ) _| ( / Amazon Linux 2 AMI ___|\___|___| https://aws.amazon.com/amazon-linux-2/ 1 package(s) needed for security, out of 5 available ... [ec2-user@ip-10-1-1-35 ~]$ sudo find /sys -name nvme [ec2-user@ip-10-1-1-35 ~]$ lspci 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02) 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II] 00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II] 00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 01) 00:02.0 VGA compatible controller: Cirrus Logic GD 5446 00:03.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01) [ec2-user@ip-10-1-1-35 ~]$ logout Connection to ec2-18-202-236-151.eu-west-1.compute.amazonaws.com closed. |
$ssh ec2-18-202-236-151.eu-west-1.compute.amazonaws.com
Last login: Tue Dec 18 12:26:12 2018 from port-90-adslby-pool35.infonet.by __| __|_ ) _| ( / Amazon Linux 2 AMI ___|\___|___| https://aws.amazon.com/amazon-linux-2/ [ec2-user@ip-10-1-1-35 ~]$ ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9001 inet 10.1.1.35 netmask 255.255.255.0 broadcast 10.1.1.255 inet6 fe80::87d:9aff:fe4a:c64 prefixlen 64 scopeid 0x20<link> ether 0a:7d:9a:4a:0c:64 txqueuelen 1000 (Ethernet) ... [ 4] 9.00-10.00 sec 118 MBytes 987 Mbits/sec 9 411 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bandwidth Retr [ 4] 0.00-10.00 sec 1.17 GBytes 1.00 Gbits/sec 117 sender [ 4] 0.00-10.00 sec 1.17 GBytes 1.00 Gbits/sec receiver iperf Done. [ec2-user@ip-10-1-1-35 ~]$ [ec2-user@ip-10-1-1-35 ~]$ [ec2-user@ip-10-1-1-35 ~]$ logout Connection to ec2-18-202-236-151.eu-west-1.compute.amazonaws.com closed. |
$ssh ec2-34-245-119-176.eu-west-1.compute.amazonaws.com
The authenticity of host 'ec2-34-245-119-176.eu-west-1.compute.amazonaws.com (34.245.119.176)' can't be established. ECDSA key fingerprint is SHA256:IewdymnYqf5JW0G8ROhFMXQqC+elmpjKZLZNsrPvp5M. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'ec2-34-245-119-176.eu-west-1.compute.amazonaws.com,34.245.119.176' (ECDSA) to the list of known hosts. __| __|_ ) _| ( / 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. ... [ 4] 7.00-8.00 sec 575 MBytes 4.82 Gbits/sec 12 1.46 MBytes [ 4] 8.00-9.00 sec 594 MBytes 4.98 Gbits/sec 0 1.48 MBytes [ 4] 9.00-10.00 sec 592 MBytes 4.97 Gbits/sec 0 1.48 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bandwidth Retr [ 4] 0.00-10.00 sec 5.76 GBytes 4.95 Gbits/sec 59 sender [ 4] 0.00-10.00 sec 5.76 GBytes 4.95 Gbits/sec receiver iperf Done. [ec2-user@ip-10-1-1-22 ~]$ logout Connection to ec2-34-245-119-176.eu-west-1.compute.amazonaws.com closed. |
$ssh 172.20.131.183
ssh: connect to host 172.20.131.183 port 22: No route to host |
$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: Saving key "/home/user/.ssh/id_rsa" failed: passphrase is too short (minimum five characters) |
$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:grmd2YM4MXdM7JwPt+HgKY/fXxIzLIpJ1BPEG0W0f2k user@m3 The key's randomart image is: +---[RSA 2048]----+ | oo++ | | oo. . | | . =o. | | + =.o o . | | = + S + * E | | O @ O + * | | + O * + . . | | . + o o | | ..o ... | +----[SHA256]-----+ |
$ls -la ./ssh
ls: cannot access './ssh': No such file or directory |
$ls -la
total 55528 drwxr-xr-x 20 user user 4096 Dec 19 10:13 . drwxr-xr-x 4 root root 4096 Dec 16 14:01 .. drwxr-xr-x 3 user user 4096 Dec 17 16:45 AWS -rw------- 1 user user 5184 Dec 18 17:05 .bash_history -rw-r--r-- 1 user user 220 May 15 2017 .bash_logout -rw-r--r-- 1 user root 10 Dec 16 14:23 .bash_profile -rw-r--r-- 1 user user 636 Dec 17 12:41 .bashrc drwx------ 9 user user 4096 Dec 18 11:47 .cache drwx------ 12 user user 4096 Dec 18 11:47 .config ... drwxr-xr-x 2 user user 4096 Dec 17 12:15 Music drwxr-xr-x 2 user user 4096 Dec 17 12:15 Pictures drwx------ 3 user user 4096 Dec 18 11:47 .pki -rw-r--r-- 1 user user 675 May 15 2017 .profile drwxr-xr-x 2 user user 4096 Dec 17 12:15 Public drwx------ 2 user user 4096 Dec 19 10:45 .ssh drwxr-xr-x 2 user user 4096 Dec 17 12:15 Templates drwxr-xr-x 2 user user 4096 Dec 17 12:15 Videos -rw------- 1 user user 7379 Dec 18 12:59 .viminfo -rw-r--r-- 1 user user 103 Dec 17 14:43 V.json |
$cd .ssh
|
$ls -la
total 28 drwx------ 2 user user 4096 Dec 19 10:45 . drwxr-xr-x 20 user user 4096 Dec 19 10:13 .. -rw-r--r-- 1 user user 167 Dec 18 12:59 config -rw------- 1 user user 1766 Dec 19 10:45 id_rsa -rw-r--r-- 1 user user 389 Dec 19 10:45 id_rsa.pub -rw-r--r-- 1 user user 1110 Dec 18 16:48 known_hosts -rw------- 1 user user 1692 Dec 18 12:49 user3.pem |
$more id_rsa
|
$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.162 ms 64 bytes from m2 (172.20.13.187): icmp_seq=2 ttl=64 time=0.078 ms ^C --- m2 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1016ms rtt min/avg/max/mdev = 0.078/0.120/0.162/0.042 ms |
$ping m3
PING m3.class.sl (127.0.1.1) 56(84) bytes of data. 64 bytes from m3.class.sl (127.0.1.1): icmp_seq=1 ttl=64 time=0.029 ms ^C --- m3.class.sl ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.029/0.029/0.029/0.000 ms |
$ping m4
PING m4 (172.20.13.186) 56(84) bytes of data. 64 bytes from m4 (172.20.13.186): icmp_seq=1 ttl=64 time=0.317 ms ^C --- m4 ping statistics --- 1 packets transmitted, 1 received, 0% packet loss, time 0ms rtt min/avg/max/mdev = 0.317/0.317/0.317/0.000 ms |
$ifconfig
bash: ifconfig: command not found |
$ifconfig -a
bash: ifconfig: command not found |
$sudo ifconfig -a
[sudo] password for user: sudo: ifconfig: command not found |
$scp .ssh/id_rsa.pub m2:~/m3_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: .ssh/id_rsa.pub: No such file or directory |
$ssh 172.20.13.183
[user@instructor:~]$ cat .ssh ec2-34-244-157-202.eu-west-1.compute.amazonaws.com| rtt min/avg/max/mdev = 0.083/0.083/0.083/0.000 ms [user@instructor:~]$ 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 [user@instructor:~]$ cat .ssh ec2-34-244-157-202.eu-west-1.compute.amazonaws.com |
$ls .ssh
ls: cannot access '.ssh': No such file or directory |
$ls -la
total 28 drwx------ 2 user user 4096 Dec 19 10:45 . drwxr-xr-x 20 user user 4096 Dec 19 10:13 .. -rw-r--r-- 1 user user 167 Dec 18 12:59 config -rw------- 1 user user 1766 Dec 19 10:45 id_rsa -rw-r--r-- 1 user user 389 Dec 19 10:45 id_rsa.pub -rw-r--r-- 1 user user 1554 Dec 19 10:54 known_hosts -rw------- 1 user user 1692 Dec 18 12:49 user3.pem |
$cd ..
|
$ls
AWS Documents github.txt libappindicator3-1_0.4.92-4_amd64.deb Music Public Videos Desktop Downloads google-chrome-stable_current_amd64.deb libappindicator3-1_0.4.92-4_i386.deb Pictures Templates V.json |
$ls -la
total 55528 drwxr-xr-x 20 user user 4096 Dec 19 10:13 . drwxr-xr-x 4 root root 4096 Dec 16 14:01 .. drwxr-xr-x 3 user user 4096 Dec 17 16:45 AWS -rw------- 1 user user 5184 Dec 18 17:05 .bash_history -rw-r--r-- 1 user user 220 May 15 2017 .bash_logout -rw-r--r-- 1 user root 10 Dec 16 14:23 .bash_profile -rw-r--r-- 1 user user 636 Dec 17 12:41 .bashrc drwx------ 9 user user 4096 Dec 18 11:47 .cache drwx------ 12 user user 4096 Dec 18 11:47 .config ... drwxr-xr-x 2 user user 4096 Dec 17 12:15 Music drwxr-xr-x 2 user user 4096 Dec 17 12:15 Pictures drwx------ 3 user user 4096 Dec 18 11:47 .pki -rw-r--r-- 1 user user 675 May 15 2017 .profile drwxr-xr-x 2 user user 4096 Dec 17 12:15 Public drwx------ 2 user user 4096 Dec 19 10:45 .ssh drwxr-xr-x 2 user user 4096 Dec 17 12:15 Templates drwxr-xr-x 2 user user 4096 Dec 17 12:15 Videos -rw------- 1 user user 7379 Dec 18 12:59 .viminfo -rw-r--r-- 1 user user 103 Dec 17 14:43 V.json |
$ls .ssh
config id_rsa id_rsa.pub known_hosts user3.pem |
$ls -la /.ssh
ls: cannot access '/.ssh': No such file or directory |
$ls -la ./ssh
ls: cannot access './ssh': No such file or directory |
$ls -la .ssh/
total 28 drwx------ 2 user user 4096 Dec 19 10:45 . drwxr-xr-x 20 user user 4096 Dec 19 10:13 .. -rw-r--r-- 1 user user 167 Dec 18 12:59 config -rw------- 1 user user 1766 Dec 19 10:45 id_rsa -rw-r--r-- 1 user user 389 Dec 19 10:45 id_rsa.pub -rw-r--r-- 1 user user 1554 Dec 19 10:54 known_hosts -rw------- 1 user user 1692 Dec 18 12:49 user3.pem |
$ls -la .ssh/
total 28 drwx------ 2 user user 4096 Dec 19 10:45 . drwxr-xr-x 20 user user 4096 Dec 19 10:59 .. -rw-r--r-- 1 user user 167 Dec 18 12:59 config -rw------- 1 user user 1766 Dec 19 10:45 id_rsa -rw-r--r-- 1 user user 389 Dec 19 10:45 id_rsa.pub -rw-r--r-- 1 user user 1554 Dec 19 10:54 known_hosts -rw------- 1 user user 1692 Dec 18 12:49 user3.pem |
Host *.compute.amazonaws.com IdentityFile ~/.ssh/user3.pem User ec2-user # ssh -i ~/.ssh/user3 ec2-user@XXXX.compute.amazonaws.com # ssh XXXX.compute.amazonaws.com
Время первой команды журнала | 14:51:55 2018-12-17 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 08:56:47 2018-12-19 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 17.82 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 3.96 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 2.78 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.60 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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