thor@jumphost ~$ ssh banner@stapp03
The authenticity of host ‘stapp03 (172.16.238.12)’ can’t be established.
ED25519 key fingerprint is SHA256:j75lU7sg+PzxLv7aCMYMQD1oZlGyuNp1kQtRu2lne74.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added ‘stapp03’ (ED25519) to the list of known hosts.
banner@stapp03’s password:
[banner@stapp03 ~]$ sudo su -
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for banner:
[root@stapp03 ~]# ls -lah /scripts
total 8.0K
drwxrwxrwx 2 root root 4.0K Nov 7 12:45 .
drwxr-xr-x 1 root root 4.0K Nov 7 12:46 …
[root@stapp03 ~]# ls -lah /backup
total 8.0K
drwxrwxrwx 2 root root 4.0K Nov 7 12:45 .
drwxr-xr-x 1 root root 4.0K Nov 7 12:46 …
[root@stapp03 ~]# cd scripts
-bash: cd: scripts: No such file or directory
[root@stapp03 ~]# cd /scripts
[root@stapp03 scripts]# vi official_backup.sh
[root@stapp03 scripts]# ls -l
total 4
-rw-r–r-- 1 root root 569 Nov 7 12:51 official_backup.sh
[root@stapp03 scripts]# which zip
/usr/bin/which: no zip in (/root/.local/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin)
[root@stapp03 scripts]# yum install -y zip
CentOS Stream 9 - BaseOS 29 kB/s | 7.3 kB 00:00
CentOS Stream 9 - BaseOS 15 MB/s | 8.8 MB 00:00
CentOS Stream 9 - AppStream 27 kB/s | 7.5 kB 00:00
CentOS Stream 9 - AppStream 1.3 MB/s | 25 MB 00:19
CentOS Stream 9 - Extras packages 39 kB/s | 8.0 kB 00:00
CentOS Stream 9 - Extras packages 42 kB/s | 20 kB 00:00
Docker CE Stable - x86_64 23 kB/s | 2.0 kB 00:00
Docker CE Stable - x86_64 353 kB/s | 59 kB 00:00
Extra Packages for Enterprise Linux 9 - 4.7 kB/s | 31 kB 00:06
Extra Packages for Enterprise Linux 9 - 2.6 MB/s | 20 MB 00:07
Extra Packages for Enterprise Linux 9 op 4.6 kB/s | 993 B 00:00
Extra Packages for Enterprise Linux 9 - 80 kB/s | 24 kB 00:00
Dependencies resolved.
Package Architecture Version Repository Size
Installing:
zip x86_64 3.0-35.el9 baseos 266 k
Installing dependencies:
unzip x86_64 6.0-59.el9 baseos 182 k
Transaction Summary
Install 2 Packages
Total download size: 447 k
Installed size: 1.1 M
Downloading Packages:
(1/2): unzip-6.0-59.el9.x86_64.rpm 307 kB/s | 182 kB 00:00
(2/2): zip-3.0-35.el9.x86_64.rpm 412 kB/s | 266 kB 00:00
Total 527 kB/s | 447 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : unzip-6.0-59.el9.x86_64 1/2
Installing : zip-3.0-35.el9.x86_64 2/2
Running scriptlet: zip-3.0-35.el9.x86_64 2/2
Verifying : unzip-6.0-59.el9.x86_64 1/2
Verifying : zip-3.0-35.el9.x86_64 2/2
Installed:
unzip-6.0-59.el9.x86_64 zip-3.0-35.el9.x86_64
Complete!
[root@stapp03 scripts]# which zip
/usr/bin/zip
[root@stapp03 scripts]# ls -l
total 4
-rw-r–r-- 1 root root 569 Nov 7 12:51 official_backup.sh
[root@stapp03 scripts]# cat official_backup.sh
#!/bin/bash
Variables
SRC_DIR=“/var/www/html/official”
BACKUP_NAME=“xfusioncorp_official.zip”
LOCAL_BACKUP_DIR=“/backup”
REMOTE_USER=“clint” # Replace with actual backup server username
REMOTE_HOST=“stbkp01” # Replace with backup server hostname
REMOTE_DIR=“/backup”
Step a: Create a zip archive of the source directory
zip -r “${LOCAL_BACKUP_DIR}/${BACKUP_NAME}” “$SRC_DIR”
Step b: Copy archive to Nautilus Backup Server
scp “${LOCAL_BACKUP_DIR}/${BACKUP_NAME}” “${REMOTE_USER}@${REMOTE_HOST}:${REMOTE_DIR}/”
End of script
[root@stapp03 scripts]# ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa
Your public key has been saved in /root/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:4Cn/F7BQyYjMS0W5iK64lgfCpnTmW5fzCGP0ktsLEFo [email protected]
The key’s randomart image is:
±–[RSA 3072]----+
| o +o+ . |
| = o + |
| E o.o |
| + +.oo. |
|.o …o.So |
|.=.oooo o . |
|. O.= . |
|+o oo O.+ . |
|o… +oo |
±—[SHA256]-----+
[root@stapp03 scripts]# ssh-copy-id clint@stbkp01
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: “/root/.ssh/id_rsa.pub”
The authenticity of host ‘stbkp01 (172.16.238.16)’ can’t be established.
ED25519 key fingerprint is SHA256:WIWCcYCdmKcIErdVQJXp1+mZuJllp8R2jtsr2j5CAQU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? 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.
[root@stapp03 scripts]# ssh clint@stbkp01
[clint@stbkp01 ~]$ exit
logout
Connection to stbkp01 closed.
[root@stapp03 scripts]# ls -l
total 4
-rw-r–r-- 1 root root 569 Nov 7 12:51 official_backup.sh
[root@stapp03 scripts]# sh official_backup.sh
adding: var/www/html/official/ (stored 0%)
adding: var/www/html/official/index.html (stored 0%)
adding: var/www/html/official/.gitkeep (stored 0%)
xfusioncorp_official.zip 100% 616 2.2MB/s 00:00
[root@stapp03 scripts]# sh official_backup.sh
updating: var/www/html/official/ (stored 0%)
updating: var/www/html/official/index.html (stored 0%)
updating: var/www/html/official/.gitkeep (stored 0%)
xfusioncorp_official.zip 100% 616 1.2MB/s 00:00
[root@stapp03 scripts]# ssh clint@stbkp01
Last login: Fri Nov 7 12:56:36 2025 from 172.16.238.12
[clint@stbkp01 ~]$ ls /backup
xfusioncorp_official.zip
[clint@stbkp01 ~]$ ls -l /backup
total 4
-rw-r–r-- 1 clint clint 616 Nov 7 12:56 xfusioncorp_official.zip
[clint@stbkp01 ~]$ which zip
/usr/bin/which: no zip in (/home/clint/.local/bin:/home/clint/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin)
[clint@stbkp01 ~]$ sudo yum install -y zip unzip
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for clint:
CentOS Stream 9 - BaseOS 488 B/s | 7.3 kB 00:15
CentOS Stream 9 - BaseOS 16 MB/s | 8.8 MB 00:00
CentOS Stream 9 - AppStream 33 kB/s | 7.5 kB 00:00
CentOS Stream 9 - AppStream 10 MB/s | 25 MB 00:02
CentOS Stream 9 - Extras packages 44 kB/s | 8.0 kB 00:00
CentOS Stream 9 - Extras packages 43 kB/s | 20 kB 00:00
Extra Packages for Enterprise Linux 9 - 150 kB/s | 31 kB 00:00
Extra Packages for Enterprise Linux 9 - 18 MB/s | 20 MB 00:01
Extra Packages for Enterprise Linux 9 op 4.4 kB/s | 993 B 00:00
Extra Packages for Enterprise Linux 9 - 97 kB/s | 24 kB 00:00
Package unzip-6.0-59.el9.x86_64 is already installed.
Dependencies resolved.
Package Architecture Version Repository Size
Installing:
zip x86_64 3.0-35.el9 baseos 266 k
Transaction Summary
Install 1 Package
Total download size: 266 k
Installed size: 724 k
Downloading Packages:
zip-3.0-35.el9.x86_64.rpm 471 kB/s | 266 kB 00:00
Total 353 kB/s | 266 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : zip-3.0-35.el9.x86_64 1/1
Running scriptlet: zip-3.0-35.el9.x86_64 1/1
Verifying : zip-3.0-35.el9.x86_64 1/1
Installed:
zip-3.0-35.el9.x86_64
Complete!
[clint@stbkp01 ~]$ ls -lah /backup
total 12K
drwxrwxrwx 2 root root 4.0K Nov 7 12:56 .
drwxr-xr-x 1 root root 4.0K Nov 7 12:58 …
-rw-r–r-- 1 clint clint 616 Nov 7 12:56 xfusioncorp_official.zip
[clint@stbkp01 ~]$ exit
logout
Connection to stbkp01 closed.
[root@stapp03 scripts]# ls -l
total 4
-rw-r–r-- 1 root root 569 Nov 7 12:51 official_backup.sh
[root@stapp03 scripts]#