Linux Bash Scripts successfully completed

Here are the commands:

ssh [email protected]
The authenticity of host ‘stapp02 (172.16.238.11)’ 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 ‘stapp02,172.16.238.11’ (ECDSA) to the list of known hosts.
[email protected]’s password:
[[email protected] ~] ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/steve/.ssh/id_rsa): Created directory '/home/steve/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/steve/.ssh/id_rsa. Your public key has been saved in /home/steve/.ssh/id_rsa.pub.The key fingerprint is: SHA256:giUSm2mBtDI74XfURMD0HRCdHffhyNGqpfZDDrbhCZE [email protected] The key's randomart image is: +---[RSA 2048]----+ |.oo ooo=+.o..o.. | |. .* .+ .o..o =..| |+.* ...o .. o.o | |o= ..+ E o | |o. .... S . + | | .. . . . B . | | = O | | + + | | . | +----[SHA256]-----+ [[email protected] ~] ssh-copy-id [email protected]
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: “/home/steve/.ssh/id_rsa.pub”
The authenticity of host ‘stbkp01 (172.16.238.16)’ can’t be established.
ECDSA key fingerprint is SHA256:1lf7lJHRQub87+t3kTd+k2wJXfxR7j4+2ztvBXRHQnc.
ECDSA key fingerprint is MD5:57:67:26:cb:40:95:19:1e:d4:15:19:82:e5:ed:18:71.
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
[email protected]’s password:

Number of key(s) added: 1

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

[[email protected] ~] vi news_backup.sh [[email protected] ~] sh news_backup.sh
adding: var/www/html/news/ (stored 0%)
adding: var/www/html/news/.gitkeep (stored 0%)
adding: var/www/html/news/index.html (stored 0%)
xfusioncorp_news.zip 100% 588 301.8KB/s 00:00
[[email protected] ~] cp news_backup.sh /scripts [[email protected] ~] cd /scripts
[[email protected] scripts] ls -al total 12 drwxrwxrwx 2 root root 4096 Aug 18 16:33 . drwxr-xr-x 1 root root 4096 Aug 18 16:29 .. -rw-rw-r-- 1 steve steve 123 Aug 18 16:33 news_backup.sh [[email protected] scripts] vi news_backup.sh
[[email protected] scripts] ssh [email protected] [[email protected] ~] ls /backup/ xfusioncorp_news.zip
ls: cannot access xfusioncorp_news.zip: No such file or directory
/backup/:
xfusioncorp_news.zip
[[email protected] ~] exit logout Connection to stbkp01 closed. [[email protected] scripts] cd /backup/
[[email protected] backup] ls -al total 12 drwxrwxrwx 2 root root 4096 Aug 18 16:32 . drwxr-xr-x 1 root root 4096 Aug 18 16:29 .. -rw-rw-r-- 1 steve steve 588 Aug 18 16:32 xfusioncorp_news.zip [[email protected] backup]
#!/bin/bash
zip -r /backup/xfusioncorp_news.zip /var/www/html/news
scp /backup/xfusioncorp_news.zip [email protected]:/backup/