/l3/users/slm/2018-12-minsk-aws/student04.BigClassRoom/user :1 :2 |
|
$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: testAWS.md no changes added to commit (use "git add" and/or "git commit -a") |
$git add
Nothing specified, nothing added. Maybe you wanted to say 'git add .'? |
$git add -p
diff --git a/testAWS.md b/testAWS.md index 08a60a3..00ec2de 100644 --- a/testAWS.md +++ b/testAWS.md @@ -1 +1 @@ -*test* **file** +**This** is a **test** *file* Stage this hunk [y,n,q,a,d,/,e,?]? s y - stage this hunk n - do not stage this hunk ... J - leave this hunk undecided, see next hunk k - leave this hunk undecided, see previous undecided hunk K - leave this hunk undecided, see previous hunk s - split the current hunk into smaller hunks e - manually edit the current hunk ? - print help @@ -1 +1 @@ -*test* **file** +**This** is a **test** *file* Stage this hunk [y,n,q,a,d,/,e,?]? y |
$git commit
# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Your branch is up-to-date with 'origin/master'. # # Changes to be committed: # modified: testAWS.md # Aborting commit due to empty commit message. |
$git add -p
No changes. |
$cd ~
|
$ls
1.json Desktop Downloads Music Public Videos AWS Documents github.txt Pictures Templates |
$sudo cd..
![]() [sudo] password for user: sudo: cd..: command not found |
$sudo ls /root
credentials.csv lilalo-install setpasswd |
$sudo cat /root/credetials.csv
![]() cat: /root/credetials.csv: No such file or directory |
$sudo cat /root/credentials.csv
user4,}E-(C9rwuVY&,AKIAIPTEFNENKAHEXQQQ,tvhZorZukurIK+uoQbLEozH3xwkVk/1bJLqkO5re,https://chubin.signin.aws.amazon.com/console |
$sudo copy /root/credentials.csv /home/user
![]() sudo: copy: command not found |
$sudo cp /root/credentials.csv /home/user
|
$cd ~
|
$ls
1.json credentials.csv Documents github.txt Pictures Templates AWS Desktop Downloads Music Public Videos |
$cat credentials.csv
user4,}E-(C9rwuVY&,AKIAIPTEFNENKAHEXQQQ,tvhZorZukurIK+uoQbLEozH3xwkVk/1bJLqkO5re,https://chubin.signin.aws.amazon.com/console |
$cat credentials.csv | tr , '<n'
user4<}E-(C9rwuVY&<AKIAIPTEFNENKAHEXQQQ<tvhZorZukurIK+uoQbLEozH3xwkVk/1bJLqkO5re<https://chubin.signin.aws.amazon.com/console |
$cat credentials.csv | tr , '\n'
user4 }E-(C9rwuVY& AKIAIPTEFNENKAHEXQQQ tvhZorZukurIK+uoQbLEozH3xwkVk/1bJLqkO5re https://chubin.signin.aws.amazon.com/console |
$cd /Downl
![]() bash: cd: /Downl: No such file or directory |
$grep bash | history
1 lsusb 2 lscpu 3 lspci 4 cls 5 cd ~ 6 ls 7 ls -l /proc/cpuinfo 8 less ls -l /proc/cpuinfo 9 free 10 free -m ... 134 sudo copy /root/credentials.csv /home/user 135 sudo cp /root/credentials.csv /home/user 136 cd ~ 137 ls 138 cat credentials.csv 139 cat credentials.csv | tr , '<n' 140 cat credentials.csv | tr , '\n' 141 cd /Downl 142 grep bash | history ^C |
$. /etc/bash_completion
|
$cd ~/Downloads/
|
$ls
user4.pem |
$mv user4.pem ~/.ssh/
|
$cd ~/.ssh/
|
$ls
known_hosts user4.pem |
$ls
known_hosts user4.pem |
$tuch config
![]() bash: tuch: command not found |
$touch config
|
$nano config
|
$Host *.compute.amazon.com
|
$Host *.compute.amazonaws.com
Host *.compute.amazonaws.com IdentityFile ~/.ssh/user4.pem User ec2-user #ssh -i ~/.ssh/user4.pem ec2-user@XXX.compute.amazonaws.com #ssh XXX.compute.amazonaws.com |
$sudo apt search visual studio code
[sudo] password for user: Sorting... Done Full Text Search... Done gyp/stable 0.1+20150913git1f374df9-1 all Cross-platform build script generator |
$gyp
![]() bash: gyp: command not found |
$sudo apt install gyp
After this operation, 1,198 kB of additional disk space will be used. Get:1 http://ftp.by.debian.org/debian stretch/main amd64 gyp all 0.1+20150913git1f374df9-1 [266 kB] Fetched 266 kB in 0s (1,928 kB/s) Selecting previously unselected package gyp. (Reading database ... 136918 files and directories currently installed.) Preparing to unpack .../gyp_0.1+20150913git1f374df9-1_all.deb ... Unpacking gyp (0.1+20150913git1f374df9-1) ... Setting up gyp (0.1+20150913git1f374df9-1) ... Processing triggers for man-db (2.7.6.1-2) ... Progress: [ 83%] [################################################..........] |
$sudo apt-get install apt-transport-https
Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: apt-transport-https 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 171 kB of archives. After this operation, 243 kB of additional disk space will be used. Get:1 http://ftp.by.debian.org/debian stretch/main amd64 apt-transport-https amd64 1.4.8 [171 kB] Fetched 171 kB in 0s (5,355 kB/s) Selecting previously unselected package apt-transport-https. (Reading database ... 136979 files and directories currently installed.) Preparing to unpack .../apt-transport-https_1.4.8_amd64.deb ... Unpacking apt-transport-https (1.4.8) ... Setting up apt-transport-https (1.4.8) ... |
$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 (102 kB/s) Reading package lists... Done |
$sudo apt-get 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. ... Creating config file /etc/gconf/2/path with new version 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) ... |
$code
|
$chmod 600 ~/.ssh/user4.pem
|
$git clone
You must specify a repository to clone. usage: git clone [<options>] [--] <repo> [<dir>] -v, --verbose be more verbose -q, --quiet be more quiet --progress force progress reporting -n, --no-checkout don't create a checkout --bare create a bare repository --mirror create a mirror repository (implies bare) -l, --local to clone from a local repository --no-hardlinks don't use local hardlinks, always copy ... --shallow-exclude <revision> deepen history of shallow clone by excluding rev --single-branch clone only one branch, HEAD or --branch --shallow-submodules any cloned submodules will be shallow --separate-git-dir <gitdir> separate git dir from working tree -c, --config <key=value> set config inside the new repository -4, --ipv4 use IPv4 addresses only -6, --ipv6 use IPv6 addresses only |
$git clone
![]() You must specify a repository to clone. usage: git clone [<options>] [--] <repo> [<dir>] -v, --verbose be more verbose -q, --quiet be more quiet --progress force progress reporting -n, --no-checkout don't create a checkout --bare create a bare repository --mirror create a mirror repository (implies bare) -l, --local to clone from a local repository --no-hardlinks don't use local hardlinks, always copy ... --shallow-exclude <revision> deepen history of shallow clone by excluding rev --single-branch clone only one branch, HEAD or --branch --shallow-submodules any cloned submodules will be shallow --separate-git-dir <gitdir> separate git dir from working tree -c, --config <key=value> set config inside the new repository -4, --ipv4 use IPv4 addresses only -6, --ipv6 use IPv6 addresses only |
$git clone https://github.com/VladislavSemko/AWS
![]() fatal: destination path 'AWS' already exists and is not an empty directory. |
$ssh ec2-34-242-229-1.eu-west-1.compute.amazonaws.com
![]() The authenticity of host 'ec2-34-242-229-1.eu-west-1.compute.amazonaws.com (34.242.229.1)' can't be established. ECDSA key fingerprint is SHA256:jOfEVRpc7jRG1Zh3x6dy2hwO3OEGwNyLTx9BD83AqNA. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'ec2-34-242-229-1.eu-west-1.compute.amazonaws.com,34.242.229.1' (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. ... /sys/class/nvme/nvme2 /sys/devices/pci0000:00/0000:00:1f.0/nvme/nvme2 find: ‘/sys/fs/pstore’: Permission denied [ec2-user@ip-10-2-1-31 ~]$ sudo find /sys -name nvme2 /sys/class/nvme/nvme2 /sys/devices/pci0000:00/0000:00:1f.0/nvme/nvme2 [ec2-user@ip-10-2-1-31 ~]$ ping 10.2.1.253 PING 10.2.1.253 (10.2.1.253) 56(84) bytes of data. 64 bytes from 10.2.1.253: icmp_seq=190 ttl=255 time=0.316 ms Connection to ec2-34-242-229-1.eu-west-1.compute.amazonaws.com closed. |
$ssh ec2-34-242-229-1.eu-west-1.compute.amazonaws.com
![]() ^C |
$ip a
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: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 6c:62:6d:7a:c4:bb brd ff:ff:ff:ff:ff:ff inet 172.20.13.186/25 brd 172.20.13.255 scope global dynamic enp0s25 valid_lft 667451sec preferred_lft 667451sec inet6 fe80::6e62:6dff:fe7a:c4bb/64 scope link valid_lft forever preferred_lft forever |
$ssh ec2-34-242-229-1.eu-west-1.compute.amazonaws.com
![]() Last login: Tue Dec 18 13:19:55 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. [ec2-user@ip-10-2-1-31 ~]$ ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 ... [ 5] 6.00-7.00 sec 579 MBytes 4.86 Gbits/sec [ 5] 7.00-8.00 sec 593 MBytes 4.97 Gbits/sec ^C[ 5] 8.00-8.81 sec 481 MBytes 4.97 Gbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bandwidth [ 5] 0.00-8.81 sec 0.00 Bytes 0.00 bits/sec sender [ 5] 0.00-8.81 sec 5.05 GBytes 4.93 Gbits/sec receiver iperf3: interrupt - the server has terminated [ec2-user@ip-10-2-1-31 ~]$ Connection to ec2-34-242-229-1.eu-west-1.compute.amazonaws.com closed by remote host. Connection to ec2-34-242-229-1.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:elQ21lkFUfA1RgMEIOpEYjLGyukUhymE0z2AnpJ8amk user@m4 The key's randomart image is: +---[RSA 2048]----+ |+B+= . . ...ooB@+| |*==.= . . . o..+| |*o= + = o .| |+B .o + . | |+ + . S | | E o | |o . . | | . | | | +----[SHA256]-----+ |
$ls -l .ssh
total 16 -rw-r--r-- 1 user user 168 Dec 18 12:59 config -rw-r--r-- 1 user user 1110 Dec 18 16:19 known_hosts -rw-r--r-- 1 user user 641 Dec 18 13:45 microsoft.gpg -rw------- 1 user user 1696 Dec 18 12:49 user4.pem |
$ls -l ~/.ssh/
total 16 -rw-r--r-- 1 user user 168 Dec 18 12:59 config -rw-r--r-- 1 user user 1110 Dec 18 16:19 known_hosts -rw-r--r-- 1 user user 641 Dec 18 13:45 microsoft.gpg -rw------- 1 user user 1696 Dec 18 12:49 user4.pem |
$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: 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:dS94M+FZpXLXPe1E6zripApLsiuWUpEMD5FumMAAuSc user@m4 The key's randomart image is: +---[RSA 2048]----+ |B+ o| |*. +=| |+B . . + +o*| |Eo* . + B.+.| |.o . S . B ...| | . . +. | | ... o o o | |.+ + o + . . | |o .o.. ... . | +----[SHA256]-----+ |
$ls -l ~/.ssh/
total 24 -rw-r--r-- 1 user user 168 Dec 18 12:59 config -rw------- 1 user user 1679 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:19 known_hosts -rw-r--r-- 1 user user 641 Dec 18 13:45 microsoft.gpg -rw------- 1 user user 1696 Dec 18 12:49 user4.pem |
$ip a
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: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 6c:62:6d:7a:c4:bb brd ff:ff:ff:ff:ff:ff inet 172.20.13.186/25 brd 172.20.13.255 scope global dynamic enp0s25 valid_lft 688767sec preferred_lft 688767sec inet6 fe80::6e62:6dff:fe7a:c4bb/64 scope link valid_lft forever preferred_lft forever |
$ls
1.json credentials.csv Documents github.txt Music Public Videos AWS Desktop Downloads id_rsa.pub Pictures Templates |
$cat id_rsa.pub > ~/.ssh/authorized_keys
|
$cat ~/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsEosBFzkE5t8DLtypraPxUqbAYzeNKaq8mYtlLfX1ebRNNHGCn/oWxAH5gjJQ8z3OXrq9/iOZsif0fCLEOfAkFmPXvSCgsJKY4CsDCBTF/T6V0eHPL7Fem/TZNqb30nsrsHaLnqxuzVW9jwXTGEa3OOyY1qr+pPZ0I30sUlMcuKOhqcY60SsAlyEddKj6Iji+fO+os/czTknxZlMgHO9433olzGUtL3x5ouLFnBzkrIcsd8ONYfAt6Q3RR8va+NY2/6XtoJkUQMUmxQv0w+7wP1UDUtwBxzypbBjwBygyI103zek+BGUZqJF2U+j58VmCMRdU16+s0JRjzspisYuP user@m5 |
$cd .ssh/
|
$ls
authorized_keys id_rsa known_hosts user4.pem config id_rsa.pub microsoft.gpg |
$scp id_rsa.pub 172.20.13.188:/home/user
The authenticity of host '172.20.13.188 (172.20.13.188)' can't be established. ECDSA key fingerprint is SHA256:ZQQgbn08LM9dzesMgPaZQFJKip2azN83riTfIV3w8EY. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '172.20.13.188' (ECDSA) to the list of known hosts. user@172.20.13.188's password: id_rsa.pub 100% 389 725.1KB/s 00:00 |
$ssh 172.20.13.188
Linux m5 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. l3-agent is already running: pid=3029; pidfile=/home/user/.lilalo/l3-agent.pid user@m5:~$ exit logout Connection to 172.20.13.188 closed. |
$^C
![]() |
$sudo netstat | gerp agent
![]() bash: gerp: command not found [sudo] password for user: Sorry, try again. [sudo] password for user: sudo: netstat: command not found |
$sudo netstat | grep agent
![]() sudo: netstat: command not found |
$sudo apt install netstat
Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package netstat |
$lsof | grep agent
systemd 957 user 21u unix 0xffff913b0fdcd000 0t0 20495 /run/user/1001/gnupg/S.gpg-agent.ssh type=STREAM systemd 957 user 22u unix 0xffff913b1130f800 0t0 20498 /run/user/1001/gnupg/S.gpg-agent.extra type=STREAM systemd 957 user 23u unix 0xffff913b1006f800 0t0 20500 /run/user/1001/gnupg/S.gpg-agent type=STREAM systemd 957 user 26u unix 0xffff913b0fdcf400 0t0 20504 /run/user/1001/gnupg/S.gpg-agent.browser type=STREAM ssh-agent 1021 user cwd unknown /proc/1021/cwd (readlink: Permission denied) ssh-agent 1021 user rtd unknown /proc/1021/root (readlink: Permission denied) ssh-agent 1021 user txt unknown /proc/1021/exe (readlink: Permission denied) ssh-agent 1021 user NOFD /proc/1021/fd (opendir: Permission denied) gnome-she 1050 user mem REG 8,1 40296 535940 /usr/lib/x86_64-linux-gnu/libpolkit-agent-1.so.0.0.0 gmain 1050 1051 user mem REG 8,1 40296 535940 /usr/lib/x86_64-linux-gnu/libpolkit-agent-1.so.0.0.0 ... l3-agent 2294 user mem REG 8,1 39256 18087946 /lib/x86_64-linux-gnu/libcrypt-2.24.so l3-agent 2294 user mem REG 8,1 1689360 18087944 /lib/x86_64-linux-gnu/libc-2.24.so l3-agent 2294 user mem REG 8,1 135440 18087959 /lib/x86_64-linux-gnu/libpthread-2.24.so l3-agent 2294 user mem REG 8,1 1063328 18087948 /lib/x86_64-linux-gnu/libm-2.24.so l3-agent 2294 user mem REG 8,1 14640 18087947 /lib/x86_64-linux-gnu/libdl-2.24.so l3-agent 2294 user mem REG 8,1 153288 18087939 /lib/x86_64-linux-gnu/ld-2.24.so l3-agent 2294 user mem REG 8,1 1679776 525531 /usr/lib/locale/locale-archive l3-agent 2294 user 0u CHR 1,3 0t0 1028 /dev/null l3-agent 2294 user 1u CHR 1,3 0t0 1028 /dev/null l3-agent 2294 user 2u CHR 1,3 0t0 1028 /dev/null |
$lsof | grep agent.3245
![]() |
$ssh -a ec2-52-17-198-245.eu-west-1.compute.amazonaws.com
__| __|_ ) _| ( / 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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P+xiOm0WOjbrpsrckitc+llJaZJXawK5RbES7a5LhMc0c8NZodqKBSC8wh5ak0uTxKA/frkhFlCL0JjGZR2liGq+hsb3WbuDVTNjkTNJxhWX user@m4 [ec2-user@ip-10-2-1-140 ~]$ exit logout Connection to ec2-52-17-198-245.eu-west-1.compute.amazonaws.com closed. |
$nano ~/.ssh/config
|
$Host *.compute.amazonaws.com
![]() The authenticity of host '52.209.134.137 (52.209.134.137)' 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 '52.209.134.137' (ECDSA) to the list of known hosts. Permission denied (publickey,gssapi-keyex,gssapi-with-mic). |
$ssh ec2-34-248-45-17.eu-west-1.compute.amazonaws.com
The authenticity of host 'ec2-34-248-45-17.eu-west-1.compute.amazonaws.com (34.248.45.17)' can't be established. ECDSA key fingerprint is SHA256:9nRn7ygUntKru+GoXjXpFeAB8PG3scSyuah54LyWKNs. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'ec2-34-248-45-17.eu-west-1.compute.amazonaws.com,34.248.45.17' (ECDSA) to the list of known hosts. Last login: Wed Dec 19 08:35:55 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 ... /home/ec2-user/.ssh/authorized_keys [ec2-user@ip-10-2-1-140 ~]$ cat ~/.ssh/authorized_keys ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIbA7/QSlIi0RoXLZPUh4wmOwjeNqA4UjReIcagPSGI5Ti9uwawpL4TjFM0cXrUdoSCCHE5xKrO4aLcLpQC6qh5eY2VW7kJkFCTUVhjNUcGsEeG9FffgxJc/I0Znk1rjvefqEWVHLaqnALYyMEu0YLBZjRIHxAYQGVxxrXsRZnyWdSkcPgT8DvIE1nZdRTBCLL6IztphyvofiHqlkTYqXHd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OyY1qr+pPZ0I30sUlMcuKOhqcY60SsAlyEddKj6Iji+fO+os/czTknxZlMgHO9433olzGUtL3x5ouLFnBzkrIcsd8ONYfAt6Q3RR8va+NY2/6XtoJkUQMUmxQv0w+7wP1UDUtwBxzypbBjwBygyI103zek+BGUZqJF2U+j58VmCMRdU16+s0JRjzspisYuP user@m5 [ec2-user@ip-10-2-1-140 ~]$ mv ~/.ssh/authorized_keys {,_} [ec2-user@ip-10-2-1-140 ~]$ exit logout Connection to ec2-34-248-45-17.eu-west-1.compute.amazonaws.com closed. |
$ssh ec2-34-248-45-17.eu-west-1.compute.amazonaws.com
Permission denied (publickey,gssapi-keyex,gssapi-with-mic). |
$ssh 34.248.45.17
![]() Permission denied (publickey,gssapi-keyex,gssapi-with-mic). |
$ssh ec2-34-248-45-17.eu-west-1.compute.amazonaws.com
![]() Permission denied (publickey,gssapi-keyex,gssapi-with-mic). |
$ssh-add .ssh/
![]() authorized_keys id_rsa known_hosts user4.pem config id_rsa.pub microsoft.gpg |
$ssh-add .ssh/user4.pem
Identity added: .ssh/user4.pem (.ssh/user4.pem) |
$ssh ec2-34-248-45-17.eu-west-1.compute.amazonaws.com
![]() Permission denied (publickey,gssapi-keyex,gssapi-with-mic). |
$sudo apt install awscli
update-alternatives: using /usr/share/docutils/scripts/python3/rst2xetex to provide /usr/bin/rst2xetex (rst2xetex) in auto mode update-alternatives: using /usr/share/docutils/scripts/python3/rst2xml to provide /usr/bin/rst2xml (rst2xml) in auto mode update-alternatives: using /usr/share/docutils/scripts/python3/rstpep2html to provide /usr/bin/rstpep2html (rstpep2html) in auto mode Processing triggers for man-db (2.7.6.1-2) ... Processing triggers for shared-mime-info (1.8-1+deb9u1) ... Setting up python3-jmespath (0.9.0-2) ... Setting up python3-dateutil (2.5.3-2) ... Setting up python3-pygments (2.2.0+dfsg-1) ... Setting up python3-botocore (1.4.70-1) ... Setting up python3-rsa (3.4.2-1) ... ... Get:7 http://ftp.by.debian.org/debian stretch/main amd64 python3-colorama all 0.3.7-1 [18.1 kB] Get:8 http://ftp.by.debian.org/debian stretch/main amd64 python3-pyasn1 all 0.1.9-2 [34.5 kB] Get:9 http://ftp.by.debian.org/debian stretch/main amd64 python3-rsa all 3.4.2-1 [30.7 kB] Get:10 http://ftp.by.debian.org/debian stretch/main amd64 python3-s3transfer all 0.1.9-1 [36.4 kB] Get:11 http://ftp.by.debian.org/debian stretch/main amd64 awscli all 1.11.13-1 [403 kB] Get:12 http://ftp.by.debian.org/debian stretch/main amd64 python3-pygments all 2.2.0+dfsg-1 [588 kB] Fetched 2,805 kB in 3s (828 kB/s) Selecting previously unselected package python3-dateutil. Setting up awscli (1.11.13-1) ... Progress: [ 98%] [#########################################################.] |
$aws-shell --version
![]() bash: aws-shell: command not found |
$sudo pip install aws-shell
![]() sudo: pip: command not found |
$sudo apt install pip
![]() Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package pip |
$aws s3 mb
![]() usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters] To see help text, you can run: aws help aws <command> help aws <command> <subcommand> help aws: error: the following arguments are required: path |
$aws s3 ls
![]() Unable to locate credentials. You can configure credentials by running "aws configure". |
$aws configure
![]() AWS Access Key ID [None]: ^C |
$pip
![]() bash: pip: command not found |
$sudo apt install pip
![]() Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package pip |
$sudo apt install python-pip
Preparing to unpack .../15-python-wheel_0.29.0-2_all.deb ... Unpacking python-wheel (0.29.0-2) ... Selecting previously unselected package python-xdg. Preparing to unpack .../16-python-xdg_0.25-4_all.deb ... Unpacking python-xdg (0.25-4) ... Setting up python-pip-whl (9.0.1-2) ... Setting up python-crypto (2.6.1-7) ... Setting up python-wheel (0.29.0-2) ... Setting up python-keyrings.alt (1.3-1) ... Setting up libexpat1-dev:amd64 (2.2.0-2+deb9u1) ... ... Setting up python2.7-dev (2.7.13-2+deb9u3) ... Setting up python-all (2.7.13-2) ... Setting up python-xdg (0.25-4) ... Setting up python-secretstorage (2.3.1-2) ... Setting up libpython-dev:amd64 (2.7.13-2) ... Setting up python-keyring (10.1-1) ... Setting up python-dev (2.7.13-2) ... Setting up libpython-all-dev:amd64 (2.7.13-2) ... Progress: [ 98%] [#########################################################.] Setting up python-all-dev (2.7.13-2) ... |
$sudo ls /
bin etc initrd.img.old lost+found opt run sys var boot home lib media proc sbin tmp vmlinuz dev initrd.img lib64 mnt root srv usr vmlinuz.old |
$sudo ls /root
credentials.csv lilalo-install setpasswd |
$sudo cat /root/credentials.csv
user4,}E-(C9rwuVY&,AKIAIPTEFNENKAHEXQQQ,tvhZorZukurIK+uoQbLEozH3xwkVk/1bJLqkO5re,https://chubin.signin.aws.amazon.com/console |
$sudo cat /root/credentials.csv | TR , '/N'
![]() bash: TR: command not found |
$aws ec2 ls
![]() usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters] To see help text, you can run: aws help aws <command> help aws <command> <subcommand> help aws: error: argument operation: Invalid choice, valid choices are: accept-reserved-instances-exchange-quote | accept-vpc-peering-connection allocate-address | allocate-hosts assign-private-ip-addresses | associate-address associate-dhcp-options | associate-route-table ... replace-route-table-association | report-instance-status request-spot-fleet | request-spot-instances reset-image-attribute | reset-instance-attribute reset-network-interface-attribute | reset-snapshot-attribute restore-address-to-classic | revoke-security-group-egress revoke-security-group-ingress | run-instances run-scheduled-instances | start-instances stop-instances | terminate-instances unassign-private-ip-addresses | unmonitor-instances wait | help |
$aws ec2 describe-instance
![]() usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters] To see help text, you can run: aws help aws <command> help aws <command> <subcommand> help aws: error: argument operation: Invalid choice, valid choices are: accept-reserved-instances-exchange-quote | accept-vpc-peering-connection allocate-address | allocate-hosts assign-private-ip-addresses | associate-address associate-dhcp-options | associate-route-table ... reset-network-interface-attribute | reset-snapshot-attribute restore-address-to-classic | revoke-security-group-egress revoke-security-group-ingress | run-instances run-scheduled-instances | start-instances stop-instances | terminate-instances unassign-private-ip-addresses | unmonitor-instances wait | help Invalid choice: 'describe-instance', maybe you meant: * describe-instances * describe-instance-status |
$aws ec2 describe-instances
![]() An error occurred (AuthFailure) when calling the DescribeInstances operation: AWS was not able to validate the provided access credentials |
$aws configure
AWS Access Key ID [****************XQQQ]: AWS Secret Access Key [****************O5re]: Default region name [eu-west-1]: Default output format [json]: |
user4,}E-(C9rwuVY&,AKIAIPTEFNENKAHEXQQQ,tvhZorZukurIK+uoQbLEozH3xwkVk/1bJLqkO5re,https://chubin.signin.aws.amazon.com/console
user4,}E-(C9rwuVY&,AKIAIPTEFNENKAHEXQQQ,tvhZorZukurIK+uoQbLEozH3xwkVk/1bJLqkO5re,https://chubin.signin.aws.amazon.com/console
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsEosBFzkE5t8DLtypraPxUqbAYzeNKaq8mYtlLfX1ebRNNHGCn/oWxAH5gjJQ8z3OXrq9/iOZsif0fCLEOfAkFmPXvSCgsJKY4CsDCBTF/T6V0eHPL7Fem/TZNqb30nsrsHaLnqxuzVW9jwXTGEa3OOyY1qr+pPZ0I30sUlMcuKOhqcY60SsAlyEddKj6Iji+fO+os/czTknxZlMgHO9433olzGUtL3x5ouLFnBzkrIcsd8ONYfAt6Q3RR8va+NY2/6XtoJkUQMUmxQv0w+7wP1UDUtwBxzypbBjwBygyI103zek+BGUZqJF2U+j58VmCMRdU16+s0JRjzspisYuP user@m5
Время первой команды журнала | 14:45:43 2018-12-17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Время последней команды журнала | 12:24:38 2018-12-19 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в журнале | 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент команд с ненулевым кодом завершения, % | 23.76 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Процент синтаксически неверно набранных команд, % | 5.94 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Суммарное время работы с терминалом *, час | 3.41 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Количество командных строк в единицу времени, команда/мин | 0.49 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Частота использования команд |
|