Linux Bash Scripts task done

ssh tony@stapp01
The authenticity of host ‘stapp01 (172.16.238.10)’ can’t be established.
ECDSA key fingerprint is SHA256:SySamszyWhhLGFiybhGBqfrr8g55wS/3e37ZpBOvICs.
ECDSA key fingerprint is MD5:6d:31:18:2a:f9:07:f3:29:dd:0a:d3:1f:6e:04:0a:db.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘stapp01,172.16.238.10’ (ECDSA) to the list of known hosts.
tony@stapp01’s password:
[tony@stapp01 ~] ssh-keygen -t rsa Generating public/private rsa key pair.Enter file in which to save the key (/home/tony/.ssh/id_rsa): Created directory '/home/tony/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/tony/.ssh/id_rsa. Your public key has been saved in /home/tony/.ssh/id_rsa.pub. The key fingerprint is: SHA256:LMe1WzolasPMpteaYLYICO2GYAFUKB5uKg/kj6bThfU tony@stapp01 The key's randomart image is: +---[RSA 2048]----+ |o.o. | |oo | |+.. . | | *. . o . . | |B..o .. S o o | |B=. . E* . * | |++*. + O.+ | |.+oo + *.o.. | |+. . o.o. | +----[SHA256]-----+ [tony@stapp01 ~] ssh-copy-id clint@stbkp01
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: “/home/tony/.ssh/id_rsa.pub”
The authenticity of host ‘stbkp01 (172.16.238.16)’ can’t be established.
ECDSA key fingerprint is SHA256:NJ569lrZm3gtHzBM+CbzozvyGioCI6eLdSHSHHDCF7I.
ECDSA key fingerprint is MD5:eb:00:72:f9:2b:67:ed:12:96:f2:4c:f6:28:f7:e1:24.
Are you sure you want to continue connecting (yes/no)? yes
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed – if you are prompted now it is to install the new keys
clint@stbkp01’s password:

Number of key(s) added: 1

Now try logging into the machine, with: “ssh ‘clint@stbkp01’”
and check to make sure that only the key(s) you wanted were added.

[tony@stapp01 ~] vi ecommerce_backup.sh [tony@stapp01 ~] sh ecommerce_backup.sh
adding: var/www/html/ecommerce/ (stored 0%)
adding: var/www/html/ecommerce/.gitkeep (stored 0%)
adding: var/www/html/ecommerce/index.html (stored 0%)
xfusioncorp_ecommerce.zip 100% 623 836.2KB/s 00:00
[tony@stapp01 ~] cd /scripts [tony@stapp01 scripts] cd …
[tony@stapp01 /] ls -al total 72 drwxr-xr-x 1 root root 4096 Aug 18 15:53 . drwxr-xr-x 1 root root 4096 Aug 18 15:53 .. -rw-r--r-- 50 root root 12090 Aug 1 2019 anaconda-post.log drwxrwxrwx 2 root root 4096 Aug 18 15:58 backup lrwxrwxrwx 1 root root 7 Aug 1 2019 bin -> usr/bin drwxr-xr-x 3 root root 4096 Jan 7 2020 boot drwxr-xr-x 16 root root 3820 Aug 18 15:53 dev -rwxr-xr-x 1 root root 0 Aug 18 15:52 .dockerenv drwxr-xr-x 1 root root 4096 Aug 18 15:52 etc drwxr-xr-x 1 root root 4096 Jan 25 2020 home lrwxrwxrwx 1 root root 7 Aug 1 2019 lib -> usr/lib lrwxrwxrwx 1 root root 9 Aug 1 2019 lib64 -> usr/lib64 drwxr-xr-x 2 root root 4096 Apr 11 2018 media drwxr-xr-x 2 root root 4096 Apr 11 2018 mnt drwxr-xr-x 2 root root 4096 Apr 11 2018 opt dr-xr-xr-x 188 root root 0 Aug 18 15:53 proc dr-xr-x--- 3 root root 4096 Jan 7 2020 root drwxr-xr-x 19 root root 520 Aug 18 15:53 run lrwxrwxrwx 1 root root 8 Aug 1 2019 sbin -> usr/sbin drwxrwxrwx 2 root root 4096 Aug 18 15:53 scripts drwxr-xr-x 2 root root 4096 Apr 11 2018 srv dr-xr-xr-x 13 root root 0 Aug 18 15:53 sys drwxrwxrwt 1 root root 4096 Aug 18 15:55 tmp drwxr-xr-x 1 root root 4096 Aug 1 2019 usr drwxr-xr-x 1 root root 4096 Jan 7 2020 var [tony@stapp01 /] cd /scripts
[tony@stapp01 scripts] ls -al total 8 drwxrwxrwx 2 root root 4096 Aug 18 15:53 . drwxr-xr-x 1 root root 4096 Aug 18 15:53 .. [tony@stapp01 scripts] vi ecommerce_backup.sh
[tony@stapp01 scripts] ls -al total 12 drwxrwxrwx 2 root root 4096 Aug 18 16:02 . drwxr-xr-x 1 root root 4096 Aug 18 15:53 .. -rw-rw-r-- 1 tony tony 140 Aug 18 16:02 ecommerce_backup.sh [tony@stapp01 scripts] ssh clint@stbkp01


[clint@stbkp01 ~] ls /backup/ xfusioncorp_ecommerce.zip ls: cannot access xfusioncorp_ecommerce.zip: No such file or directory /backup/: xfusioncorp_ecommerce.zip [clint@stbkp01 ~] exit
logout
Connection to stbkp01 closed.
[tony@stapp01 scripts] exit logout Connection to stapp01 closed. thor@jump_host / ssh clint@stbkp01
The authenticity of host ‘stbkp01 (172.16.238.16)’ can’t be established.
ECDSA key fingerprint is SHA256:NJ569lrZm3gtHzBM+CbzozvyGioCI6eLdSHSHHDCF7I.
ECDSA key fingerprint is MD5:eb:00:72:f9:2b:67:ed:12:96:f2:4c:f6:28:f7:e1:24.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘stbkp01,172.16.238.16’ (ECDSA) to the list of known hosts.
clint@stbkp01’s password:
Last login: Tue Aug 18 16:04:19 2020 from stapp01
[clint@stbkp01 ~] ls /backup/ xfusioncorp_ecommerce.zip [clint@stbkp01 ~] Connection to host01 closed by remote host.
Connection to host01 closed.