/l3/users/slm/2018-12-minsk-aws/student05.BigClassRoom/user :1 :2 |
|
$man git
|
$vi README.md
|
$git add README.md
|
$git co
commit config |
$git commit "edit readme"
error: pathspec 'edit readme' did not match any file(s) known to git. |
$ls
README.md |
$git config --global user.email "hikinsuchi@gmail.com"
|
$git push
Username for 'https://github.com': pisanny Password for 'https://pisanny@github.com': Counting objects: 3, done. Writing objects: 100% (3/3), 249 bytes | 0 bytes/s, done. Total 3 (delta 0), reused 0 (delta 0) To https://github.com/pisanny/aws 16f23f7..27b135c master -> master |
$git sta
stage stash status |
$git status
On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working tree clean |
$vi hello.md
|
$git status
On branch master Your branch is up-to-date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed) hello.md nothing added to commit but untracked files present (use "git add" to track) |
$git status
On branch master Your branch is up-to-date with 'origin/master'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: hello.md |
$git commit -m "add hello.md"
[master 2b8a094] add hello.md 1 file changed, 1 insertion(+) create mode 100644 hello.md |
$git status
On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working tree clean |
$git pu
pull push |
$git pull
remote: Enumerating objects: 5, done. remote: Counting objects: 100% (5/5), done. remote: Compressing objects: 100% (2/2), done. remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 Unpacking objects: 100% (3/3), done. From https://github.com/pisanny/aws 2b8a094..f960df5 master -> origin/master Updating 2b8a094..f960df5 Fast-forward hello.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) |
$cat hello.md
# Hello Hello world! |
$hist
hist_append history |
$history | grep git
86 git 87 sudo apt install git 88 sudo apt install git-core 89 vi github.txt 90 cat github.txt 91 git https://github.com/pisanny 92 git --help 93 man git 94 git clone https://github.com/pisanny 95 git clone https://github.com/pisanny/ps ... 117 git status 118 git add . 119 git status 120 git commit -m "add hello.md" 121 git status 122 git log 123 git push 124 git status 125 git pull 127 history | grep git |
$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 18eb17f..03e5211 100644 --- a/hello.md +++ b/hello.md @@ -1,3 +1,7 @@ +##Introduction + +Introduction to the hello topic. + # Hello ... + +Introduction to the hello topic. + # Hello Stage this hunk [y,n,q,a,d,/,j,J,g,e,?]? n @@ -1,3 +5,3 @@ # Hello -Hello world! +Hello **world**! Stage this hunk [y,n,q,a,d,/,K,g,e,?]? y |
$git status
On branch master Your branch is up-to-date with 'origin/master'. Changes to be committed: (use "git reset HEAD <file>..." to unstage) modified: hello.md 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 |
$git commit -m "add Introduction"
[master 6dace8e] add Introduction 1 file changed, 4 insertions(+) |
$sudo cat /root/credentials.csv
user5,k!oDh|!SQ%Ba,AKIAJKUHEIKJ53Q5J73A,FYYm7Jky8U5oQXy2B4N/xCMdHHgeZmQfWiA6RZfX,https://chubin.signin.aws.amazon.com/console |
$sudo cat /root/setpasswd
#!/bin/bash cat <<EOF | chpasswd user:password root:rootpass EOF |
$sudo cat /root/setpasswd | tr , '\n'
#!/bin/bash cat <<EOF | chpasswd user:password root:rootpass EOF |
$sudo cat /root/credentials.csv | tr , '\n'
user5 k!oDh|!SQ%Ba AKIAJKUHEIKJ53Q5J73A FYYm7Jky8U5oQXy2B4N/xCMdHHgeZmQfWiA6RZfX https://chubin.signin.aws.amazon.com/console |
$ls\
> ^C |
$ls
1.json aws Desktop Documents Downloads github.txt Music Pictures Public Templates Videos |
$ls -la
total 120 drwxr-xr-x 18 user user 4096 Dec 18 10:07 . drwxr-xr-x 4 root root 4096 Dec 16 14:01 .. -rw-r--r-- 1 user user 47 Dec 17 14:40 1.json drwxr-xr-x 3 user user 4096 Dec 17 16:45 aws -rw------- 1 user user 2458 Dec 17 17:04 .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 637 Dec 17 12:41 .bashrc drwx------ 12 user user 4096 Dec 17 13:58 .cache ... drwxr-xr-x 3 user user 4096 Dec 17 12:15 .local drwx------ 5 user user 4096 Dec 17 12:16 .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:24 .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 6476 Dec 17 16:45 .viminfo |
$cd Do
Documents/ Downloads/ |
$cd Downloads/
|
$ls
user5.pem |
$cp user5.pem ~/.ssh
|
$cd ~
|
$ls .ssh/
known_hosts user5.pem |
$vi ~/.ssh/
|
$vi ~/.ssh/config
|
$curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 983 100 983 0 0 2129 0 --:--:-- --:--:-- --:--:-- 2132 |
$sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
|
$sudo apt-get update
Ign:1 http://ftp.by.debian.org/debian stretch InRelease Hit:2 http://ftp.by.debian.org/debian stretch Release Get:4 https://packages.microsoft.com/repos/vscode stable InRelease [3,182 B] Get:5 https://packages.microsoft.com/repos/vscode stable/main amd64 Packages [83.8 kB] Fetched 87.0 kB in 0s (96.1 kB/s) Reading package lists... Done |
$sudo apt install code
Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: gconf-service gconf2-common libgconf-2-4 The following NEW packages will be installed: code gconf-service gconf2-common libgconf-2-4 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. Need to get 47.0 MB of archives. After this operation, 202 MB of additional disk space will be used. ... Processing triggers for mime-support (3.60) ... Processing triggers for desktop-file-utils (0.23-1) ... Processing triggers for sgml-base (1.29) ... Processing triggers for libc-bin (2.24-11+deb9u3) ... Processing triggers for gnome-menus (3.13.3-9) ... Setting up libgconf-2-4:amd64 (3.2.6-4+b1) ... Setting up gconf-service (3.2.6-4+b1) ... Setting up code (1.30.0-1544567151) ... Processing triggers for libc-bin (2.24-11+deb9u3) ... Progress: [ 95%] [################################################################################################.....] |
$lsb
lsblk lsb_release |
$lsb_release
No LSB modules are available. |
$lsb_release -a
No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 9.6 (stretch) Release: 9.6 Codename: stretch |
$ssh west-1.compute.amazonaws.com
ssh: Could not resolve hostname west-1.compute.amazonaws.com: Name or service not known |
$ssh west-1.compute.amazonaws.com
ssh: Could not resolve hostname west-1.compute.amazonaws.com: Name or service not known |
$ssh ec2-34-244-173-136.eu-west-1.compute.amazonaws.com
The authenticity of host 'ec2-34-244-173-136.eu-west-1.compute.amazonaws.com (34.244.173.136)' can't be established. ECDSA key fingerprint is SHA256:j5DwZ2NTVudryOYSEkHUEdwr2MODsLZveIwydtu1GpI. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'ec2-34-244-173-136.eu-west-1.compute.amazonaws.com,34.244.173.136' (ECDSA) to the list of known hosts. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0644 for '/home/user/.ssh/user5.pem' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. Load key "/home/user/.ssh/user5.pem": bad permissions Permission denied (publickey,gssapi-keyex,gssapi-with-mic). |
$free -m
total used free shared buff/cache available Mem: 7952 1436 5081 172 1434 6089 Swap: 8154 0 8154 |
$df -h
Filesystem Size Used Avail Use% Mounted on udev 3.9G 0 3.9G 0% /dev tmpfs 796M 9.2M 787M 2% /run /dev/sda1 450G 4.8G 422G 2% / tmpfs 3.9G 12M 3.9G 1% /dev/shm tmpfs 5.0M 4.0K 5.0M 1% /run/lock tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup tmpfs 796M 20K 796M 1% /run/user/117 tmpfs 796M 32K 796M 1% /run/user/1001 |
$fdisk -l
bash: fdisk: command not found |
$ls
1.json aws Desktop Documents Downloads github.txt microsoft.gpg Music Pictures Public Templates Videos |
$ssh ec2-34-244-173-136.eu-west-1.compute.amazonaws.com
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0644 for '/home/user/.ssh/user5.pem' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. Load key "/home/user/.ssh/user5.pem": bad permissions Permission denied (publickey,gssapi-keyex,gssapi-with-mic). |
$chmod 0644 /home/user/.ssh/user5.pem
|
$clear
|
$ssh ec2-34-244-173-136.eu-west-1.compute.amazonaws.com
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0644 for '/home/user/.ssh/user5.pem' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. Load key "/home/user/.ssh/user5.pem": bad permissions Permission denied (publickey,gssapi-keyex,gssapi-with-mic). |
$ls -la .ssh/
total 20 drwx------ 2 user user 4096 Dec 18 12:59 . drwxr-xr-x 21 user user 4096 Dec 18 13:56 .. -rw-r--r-- 1 user user 78 Dec 18 12:58 config -rw-r--r-- 1 user user 666 Dec 18 15:15 known_hosts -r-------- 1 user user 1692 Dec 18 12:50 user5.pem |
$sudo apt update
Ign:1 http://ftp.by.debian.org/debian stretch InRelease Hit:2 http://ftp.by.debian.org/debian stretch Release Hit:4 https://packages.microsoft.com/repos/vscode stable InRelease Reading package lists... Done Building dependency tree Reading state information... Done 1 package can be upgraded. Run 'apt list --upgradable' to see it. |
$sudo apt upgrade
Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages will be upgraded: code 1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B/45.9 MB of archives. After this operation, 1,024 B of additional disk space will be used. Do you want to continue? [Y/n] y Reading changelogs... Done (Reading database ... 138778 files and directories currently installed.) Preparing to unpack .../code_1.30.1-1545156774_amd64.deb ... Unpacking code (1.30.1-1545156774) over (1.30.0-1544567151) ... Processing triggers for mime-support (3.60) ... Processing triggers for desktop-file-utils (0.23-1) ... Setting up code (1.30.1-1545156774) ... Processing triggers for gnome-menus (3.13.3-9) ... Progress: [ 83%] [#############################################################################................] |
$sudo apt install xfce
xfce4 xfce4-mailwatch-plugin xfce4-screenshooter-plugin xfce4-appfinder xfce4-messenger-plugin xfce4-sensors-plugin xfce4-battery-plugin xfce4-mount-plugin xfce4-session xfce4-clipman xfce4-mpc-plugin xfce4-session-dbg xfce4-clipman-plugin xfce4-netload-plugin xfce4-settings xfce4-cpufreq-plugin xfce4-notes xfce4-smartbookmark-plugin xfce4-cpugraph-plugin xfce4-notes-plugin xfce4-systemload-plugin xfce4-datetime-plugin xfce4-notifyd xfce4-taskmanager xfce4-dev-tools xfce4-panel xfce4-terminal xfce4-dict xfce4-panel-dev xfce4-timer-plugin xfce4-diskperf-plugin xfce4-places-plugin xfce4-topmenu-plugin xfce4-equake-plugin xfce4-power-manager xfce4-verve-plugin xfce4-fsguard-plugin xfce4-power-manager-data xfce4-wavelan-plugin xfce4-genmon-plugin xfce4-power-manager-plugins xfce4-weather-plugin xfce4-goodies xfce4-pulseaudio-plugin xfce4-whiskermenu-plugin xfce4-hdaps xfce4-quicklauncher-plugin xfce4-wmdock-plugin xfce4-indicator-plugin xfce4-radio-plugin xfce4-xkb-plugin xfce4-linelight-plugin xfce4-screenshooter xfce-keyboard-shortcuts |
$sudo apt install xfce
xfce4 xfce4-mailwatch-plugin xfce4-screenshooter-plugin xfce4-appfinder xfce4-messenger-plugin xfce4-sensors-plugin xfce4-battery-plugin xfce4-mount-plugin xfce4-session xfce4-clipman xfce4-mpc-plugin xfce4-session-dbg xfce4-clipman-plugin xfce4-netload-plugin xfce4-settings xfce4-cpufreq-plugin xfce4-notes xfce4-smartbookmark-plugin xfce4-cpugraph-plugin xfce4-notes-plugin xfce4-systemload-plugin xfce4-datetime-plugin xfce4-notifyd xfce4-taskmanager xfce4-dev-tools xfce4-panel xfce4-terminal xfce4-dict xfce4-panel-dev xfce4-timer-plugin xfce4-diskperf-plugin xfce4-places-plugin xfce4-topmenu-plugin xfce4-equake-plugin xfce4-power-manager xfce4-verve-plugin xfce4-fsguard-plugin xfce4-power-manager-data xfce4-wavelan-plugin xfce4-genmon-plugin xfce4-power-manager-plugins xfce4-weather-plugin xfce4-goodies xfce4-pulseaudio-plugin xfce4-whiskermenu-plugin xfce4-hdaps xfce4-quicklauncher-plugin xfce4-wmdock-plugin xfce4-indicator-plugin xfce4-radio-plugin xfce4-xkb-plugin xfce4-linelight-plugin xfce4-screenshooter xfce-keyboard-shortcuts |
$sudo apt install xfce4
xfce4 xfce4-mailwatch-plugin xfce4-screenshooter-plugin xfce4-appfinder xfce4-messenger-plugin xfce4-sensors-plugin xfce4-battery-plugin xfce4-mount-plugin xfce4-session xfce4-clipman xfce4-mpc-plugin xfce4-session-dbg xfce4-clipman-plugin xfce4-netload-plugin xfce4-settings xfce4-cpufreq-plugin xfce4-notes xfce4-smartbookmark-plugin xfce4-cpugraph-plugin xfce4-notes-plugin xfce4-systemload-plugin xfce4-datetime-plugin xfce4-notifyd xfce4-taskmanager xfce4-dev-tools xfce4-panel xfce4-terminal xfce4-dict xfce4-panel-dev xfce4-timer-plugin xfce4-diskperf-plugin xfce4-places-plugin xfce4-topmenu-plugin xfce4-equake-plugin xfce4-power-manager xfce4-verve-plugin xfce4-fsguard-plugin xfce4-power-manager-data xfce4-wavelan-plugin xfce4-genmon-plugin xfce4-power-manager-plugins xfce4-weather-plugin xfce4-goodies xfce4-pulseaudio-plugin xfce4-whiskermenu-plugin xfce4-hdaps xfce4-quicklauncher-plugin xfce4-wmdock-plugin xfce4-indicator-plugin xfce4-radio-plugin xfce4-xkb-plugin xfce4-linelight-plugin xfce4-screenshooter |
$sudo apt install xfce4
Selecting previously unselected package libxfce4panel-2.0-4. Preparing to unpack .../21-libxfce4panel-2.0-4_4.12.1-2_amd64.deb ... Unpacking libxfce4panel-2.0-4 (4.12.1-2) ... Selecting previously unselected package libxfce4ui-2-0. Preparing to unpack .../22-libxfce4ui-2-0_4.12.1-2_amd64.deb ... Unpacking libxfce4ui-2-0 (4.12.1-2) ... Selecting previously unselected package libxfce4ui-utils. Preparing to unpack .../23-libxfce4ui-utils_4.12.1-2_amd64.deb ... Unpacking libxfce4ui-utils (4.12.1-2) ... Selecting previously unselected package libxfce4util-bin. ... Setting up xfdesktop4 (4.12.3-3) ... Setting up xfce4-pulseaudio-plugin:amd64 (0.2.4-1) ... Setting up xfce4-session (4.12.1-5) ... Setting up thunar (1.6.11-1) ... Setting up xfce4 (4.12.3) ... Setting up thunar-volman (0.8.1-2) ... Processing triggers for libc-bin (2.24-11+deb9u3) ... Processing triggers for dbus (1.10.26-0+deb9u1) ... Processing triggers for systemd (232-25+deb9u6) ... Progress: [ 99%] [############################################################################################.] |
$sudo apt install xfce4-g
xfce4-genmon-plugin xfce4-goodies |
$sudo apt install xfce4-goodies
Unpacking libgtksourceview2.0-common (2.10.5-3) ... Selecting previously unselected package libgtksourceview2.0-0:amd64. Preparing to unpack .../01-libgtksourceview2.0-0_2.10.5-3_amd64.deb ... Unpacking libgtksourceview2.0-0:amd64 (2.10.5-3) ... Selecting previously unselected package libqrencode3:amd64. Preparing to unpack .../02-libqrencode3_3.4.4-1+b2_amd64.deb ... Unpacking libqrencode3:amd64 (3.4.4-1+b2) ... Selecting previously unselected package libunique-1.0-0. Preparing to unpack .../03-libunique-1.0-0_1.1.6-5_amd64.deb ... Unpacking libunique-1.0-0 (1.1.6-5) ... ... Setting up xfce4-netload-plugin (1.2.4-2) ... Setting up xfce4-notes (1.8.1-1) ... Setting up libgtksourceview2.0-0:amd64 (2.10.5-3) ... Setting up mousepad (0.4.0-4) ... Setting up xfce4-power-manager (1.4.4-4) ... Setting up xfce4-clipman-plugin (2:1.4.1-1) ... Setting up xfce4-notes-plugin (1.8.1-1) ... Setting up xfce4-goodies (4.12.3) ... Setting up xfce4-power-manager-plugins (1.4.4-4) ... Processing triggers for libc-bin (2.24-11+deb9u3) ... |
$ssh ec2-34-255-0-156.eu-west-1.compute.amazonaws.com
The authenticity of host 'ec2-34-255-0-156.eu-west-1.compute.amazonaws.com (34.255.0.156)' can't be established. ECDSA key fingerprint is SHA256:JDRMldzWADKCwl7wdNRV91x7eOKh/56CFsRwu7zRm6I. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'ec2-34-255-0-156.eu-west-1.compute.amazonaws.com,34.255.0.156' (ECDSA) to the list of known hosts. __| __|_ ) _| ( / 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. [ec2-user@ip-10-2-1-190 ~]$ [ec2-user@ip-10-2-1-190 ~]$ [ec2-user@ip-10-2-1-190 ~]$ [ec2-user@ip-10-2-1-190 ~]$ [ec2-user@ip-10-2-1-190 ~]$ ls .ssh/ authorized_keys [ec2-user@ip-10-2-1-190 ~]$ cat .ssh/authorized_keys ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCAo34USduh8HrQmYtNe8V5VfjeOXeerhHZ/yYAnA5x7NWV3omATO6YaJmKllyjeSd+ZOCcjyws0pq1E2dZ4dg71G7i9myAH/Jtmi0KZ4BppE5ZoDVAzXf3eFa2UGl8u/rNK5Pmy5V1VkDG7oYdGitd/1yoHdvn7MsWZ3zZiExdSr/02u4KQpyGAoVAeieUSGM+GXF3gsKA41X2JOiB0nArOZ8f1u2TWL7gF2/ufGTASjTsxa7ztj+pigS8R3qmo4+BggFfLW9gWVSbM5bRIMnXiDh/VggjusdpS7o6rAQMwUAU0lH9/g4mHm+23QmfSciZBO5b1N/OMJumCFjy9Gnd user5 [ec2-user@ip-10-2-1-190 ~]$ exit logout Connection to ec2-34-255-0-156.eu-west-1.compute.amazonaws.com closed. |
$ssh ec2-34-255-0-156.eu-west-1.compute.amazonaws.com
Last login: Wed Dec 19 07:32:19 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. [ec2-user@ip-10-2-1-190 ~]$ exit logout Connection to ec2-34-255-0-156.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): 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:n3zpNsfnG7Z5HR2ODRtkVStn/zn3hIFx0ZU8HnvVuik user@m5 The key's randomart image is: +---[RSA 2048]----+ | +oB| | o *=| | +.o==| | *=+o| | S . Oo=| | o .E+o*+| | + oo.=*| | oo +.@| | ..o *=| +----[SHA256]-----+ |
$ls .ssh/
config id_rsa id_rsa.pub known_hosts user5.pem |
$scp .ssh/id_rsa.pub 172.20.13.186:/home/user
The authenticity of host '172.20.13.186 (172.20.13.186)' can't be established. ECDSA key fingerprint is SHA256:pOkdRRt2z4ZrU7Qozrv3xmiqfnlZr+uN+aJ7Be3rVe0. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '172.20.13.186' (ECDSA) to the list of known hosts. user@172.20.13.186's password: id_rsa.pub 100% 389 197.2KB/s 00:00 |
$ls .ssh/
config id_rsa id_rsa.pub known_hosts user5.pem |
$touch .ssh/authorized_keys
|
$cat id_rsa.pub >> .ssh/authorized_keys
|
$ssh-
ssh-add ssh-agent ssh-argv0 ssh-copy-id ssh-keygen ssh-keyscan |
$man ssh-copy-id
|
$cd .ssh/
|
$ssh-add -l
2048 SHA256:n3zpNsfnG7Z5HR2ODRtkVStn/zn3hIFx0ZU8HnvVuik user@m5 (RSA) |
$ssh-add user5.pem
Identity added: user5.pem (user5.pem) |
$ssh-add -l
2048 SHA256:x6TnqJ/D2QGdjhwFO4I6bYlg565IfSoLYc8sSmJFhqI user5.pem (RSA) 2048 SHA256:n3zpNsfnG7Z5HR2ODRtkVStn/zn3hIFx0ZU8HnvVuik user@m5 (RSA) |
$export | grep SSH
declare -x SSH_AGENT_PID="1193" declare -x SSH_AUTH_SOCK="/run/user/1001/keyring/ssh" |
$host m5
Host m5 not found: 2(SERVFAIL) |
$host m4
Host m4 not found: 2(SERVFAIL) |
$cd !
bash: cd: !: No such file or directory |
$ssh ec2-34-255-0-156.eu-west-1.compute.amazonaws.com
[ec2-user@ip-10-2-1-190 ~]$ [ec2-user@ip-10-2-1-190 ~]$ [ec2-user@ip-10-2-1-190 ~]$ [ec2-user@ip-10-2-1-190 ~]$ [ec2-user@ip-10-2-1-190 ~]$ [ec2-user@ip-10-2-1-190 ~]$ [ec2-user@ip-10-2-1-190 ~]$ exit logout Connection to ec2-34-255-0-156.eu-west-1.compute.amazonaws.com closed. |
$ssh 52.17.198.245
Permission denied (publickey,gssapi-keyex,gssapi-with-mic). |
$ssh 52.17.198.245
Permission denied (publickey,gssapi-keyex,gssapi-with-mic). |
$ssh 52.17.198.245
Permission denied (publickey,gssapi-keyex,gssapi-with-mic). |
$clear
|
$vi .ssh/config
|
$ssh ec2-34-255-207-116.eu-west-1.compute.amazonaws.com
The authenticity of host 'ec2-34-255-207-116.eu-west-1.compute.amazonaws.com (34.255.207.116)' can't be established. ECDSA key fingerprint is SHA256:JDRMldzWADKCwl7wdNRV91x7eOKh/56CFsRwu7zRm6I. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'ec2-34-255-207-116.eu-west-1.compute.amazonaws.com,34.255.207.116' (ECDSA) to the list of known hosts. [ec2-user@ip-10-2-1-190 ~]$ [ec2-user@ip-10-2-1-190 ~]$ [ec2-user@ip-10-2-1-190 ~]$ [ec2-user@ip-10-2-1-190 ~]$ .ssh/authorized_keys -bash: .ssh/authorized_keys: Permission denied [ec2-user@ip-10-2-1-190 ~]$ sudo -e.ssh/authorized_keys ... usage: sudo -l [-AknS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command] usage: sudo [-AbEHknPS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-u user] [VAR=value] [-i|-s] [<command>] usage: sudo -e [-AknS] [-r role] [-t type] [-C num] [-g group] [-h host] [-p prompt] [-u user] file ... [ec2-user@ip-10-2-1-190 ~]$ sudo -e .ssh/authorized_keys sudo: .ssh/authorized_keys: editing files in a writable directory is not permitted [ec2-user@ip-10-2-1-190 ~]$ sudo rm .ssh/authorized_keys [ec2-user@ip-10-2-1-190 ~]$ exit logout Connection to ec2-34-255-207-116.eu-west-1.compute.amazonaws.com closed. |
$apt install ice
Display all 227 possibilities? (y or n) icecast2 icedove-l10n-pl iceowl-l10n-hr iceweasel-l10n-bs iceweasel-l10n-lt icecc icedove-l10n-pt-br iceowl-l10n-hsb iceweasel-l10n-ca iceweasel-l10n-lv icecc-monitor icedove-l10n-pt-pt iceowl-l10n-hu iceweasel-l10n-cak iceweasel-l10n-mai icecream icedove-l10n-rm iceowl-l10n-hy-am iceweasel-l10n-cs iceweasel-l10n-mk icedax icedove-l10n-ro iceowl-l10n-id iceweasel-l10n-cy iceweasel-l10n-ml icedove icedove-l10n-ru iceowl-l10n-is iceweasel-l10n-da iceweasel-l10n-mr icedove-bidiui icedove-l10n-si iceowl-l10n-it iceweasel-l10n-de iceweasel-l10n-ms icedove-dbg icedove-l10n-sk iceowl-l10n-ja iceweasel-l10n-dsb iceweasel-l10n-my icedove-l10n-all icedove-l10n-sl iceowl-l10n-kab iceweasel-l10n-el iceweasel-l10n-nb-no ... icedove-l10n-gl iceowl-l10n-da iceowl-l10n-zh-tw iceweasel-l10n-hr iceweasel-l10n-th icedove-l10n-he iceowl-l10n-de ices2 iceweasel-l10n-hsb iceweasel-l10n-tr icedove-l10n-hr iceowl-l10n-dsb iceweasel iceweasel-l10n-hu iceweasel-l10n-uk icedove-l10n-hsb iceowl-l10n-el iceweasel-l10n-ach iceweasel-l10n-hy-am iceweasel-l10n-ur icedove-l10n-hu iceowl-l10n-en-gb iceweasel-l10n-af iceweasel-l10n-ia iceweasel-l10n-uz icedove-l10n-hy-am iceowl-l10n-es-ar iceweasel-l10n-all iceweasel-l10n-id iceweasel-l10n-vi icedove-l10n-id iceowl-l10n-es-es iceweasel-l10n-an iceweasel-l10n-is iceweasel-l10n-xh icedove-l10n-is iceowl-l10n-et iceweasel-l10n-ar iceweasel-l10n-it iceweasel-l10n-zh-cn icedove-l10n-it iceowl-l10n-eu iceweasel-l10n-as iceweasel-l10n-ja iceweasel-l10n-zh-tw --More-- ^C |
$apt install icedtea-
icedtea-8-plugin icedtea-netx icedtea-netx-common icedtea-plugin |
$apt install icedtea-plugin
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root? |
$sudo apt install icedtea-
icedtea-8-plugin icedtea-netx icedtea-netx-common icedtea-plugin |
$sudo apt install icedtea-netx
Reading package lists... Done Building dependency tree Reading state information... Done icedtea-netx is already the newest version (1.6.2-3.1). icedtea-netx set to manually installed. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. |
$ssh ec2-34-255-207-116.eu-west-1.compute.amazonaws.com
Permission denied (publickey,gssapi-keyex,gssapi-with-mic). |
$sudo -s
root@m5:/home/user# pip install awscli bash: pip: command not found root@m5:/home/user# exit exit |
user5,k!oDh|!SQ%Ba,AKIAJKUHEIKJ53Q5J73A,FYYm7Jky8U5oQXy2B4N/xCMdHHgeZmQfWiA6RZfX,https://chubin.signin.aws.amazon.com/console
#!/bin/bash cat <<EOF | chpasswd user:password root:rootpass EOF
# Hello Hello world!
Время первой команды журнала | 13:51:38 2018-12-17 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 11:43:51 2018-12-19 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 13.86 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 0.99 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 3.91 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.43 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|
В журнал автоматически попадают все команды, данные в любом терминале системы.
Для того чтобы убедиться, что журнал на текущем терминале ведётся, и команды записываются, дайте команду 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