Transfer files and connect to remote systems.
Identify running system services and obtain process information.
Outcomes
Log in to a remote Linux system.
Identify and obtain information for processes running in the system.
Compress and extract files and directories.
Remotely transfer files.
As the student user on the workstation machine, use the lab command to prepare your environment for this exercise, and to ensure that all required resources are available.
[student@workstation ~]$ lab start network-review
Instructions
As the student user on the servera machine, verify whether the tuned system service is active.
Save the active status of the tuned service to the ~/service-status.txt file.
Find the PID of the firewalld process and save it to the ~/service-pid.txt file.
Use student as the password for the student user to authenticate to the servera machine.
Log in to the servera machine as the student user.
Use student as the password.
[student@workstation ~]$ssh student@serverastudent@servera's password:student...output omitted... [student@servera ~]$
Verify that the tuned system service is active.
[student@servera ~]$ systemctl is-active tuned
activeSave the tuned service status to the ~/service-status.txt file.
[student@servera ~]$ systemctl is-active tuned > ~/service-status.txtFind the PID of the firewalld process.
The PID in your environment might be different.
[student@servera ~]$ pgrep -f firewalld
808Save the PID of the firewalld process to the ~/service-pid.txt file.
[student@servera ~]$ pgrep -f firewalld > ~/service-pid.txtOn the servera machine, create the ~/Scripts directory.
Copy all files that have the string .sh as an extension in the /usr/local/bin/ directory to the ~/Scripts directory.
Create the ~/Scripts directory.
[student@servera ~]$ mkdir ScriptsVerify the contents of the /usr/local/bin/ directory.
[student@servera ~]$ ls -l /usr/local/bin/
total 24
-rw-r--r--. 1 root root 140 Nov 26 19:05 configure_users.sh
-rw-r--r--. 1 root root 120 Nov 26 19:05 create.shares.txt
-rw-r--r--. 1 root root 120 Nov 26 19:05 custom_audio.ksh
-rw-r--r--. 1 root root 120 Nov 26 19:05 download_documentation_sh
-rw-r--r--. 1 root root 130 Nov 26 19:05 download_tools.sh
-rw-r--r--. 1 root root 120 Nov 26 19:05 install_packages.shCopy all files in the /usr/local/bin/ directory that have the string .sh as an extension to the ~/Scripts directory.
[student@servera ~]$ cp /usr/local/bin/*.sh Scripts/Verify the copied files.
[student@servera ~]$ ls -l Scripts/
total 12
-rw-r--r--. 1 student student 140 Nov 26 19:06 configure_users.sh
-rw-r--r--. 1 student student 130 Nov 26 19:06 download_tools.sh
-rw-r--r--. 1 student student 120 Nov 26 19:06 install_packages.shOn the servera machine, create the ~/my-files.tar.xz compressed file as the backup of the Calendar, Documents, Notes, and Scripts directories.
Also include the service-status.txt and service-pid.txt files in the backup.
Use either the command line or the Files application to create the backup.
On the command line, use the tar command to create the ~/my-files.tar.xz compressed file.
Include the Calendar, Documents, Notes, and Scripts directories, and the service-status.txt and service-pid.txt files in the backup.
[student@servera ~]$ tar --create --xz --file my-files.tar.xz \
Calendar/ Documents/ Notes/ Scripts/ service-status.txt service-pid.txtAlternatively, open the Files application and click .
In the field, type ssh:// for the protocol and student@servera for the user and remote server information.
Click .
Use student as the password.
Select the Calendar. Documents, Notes, and Scripts directories, and the two text files.
Right-click the selected files and click .
Enter my-files as the archive name and select the .tar.xz format from the drop-down list.
Click .
Close the Files application.
On the workstation machine, transfer the ~/my-files.tar.xz file from the servera machine to the home directory of the student user in the workstation machine.
Create the Migrated Files directory and use it to extract the my-files.tar.xz file contents.
Exit the servera machine.
[student@servera ~]$ exit
logout
Connection to servera closed.
[student@workstation ~]$Transfer the ~/my-files.tar.xz compressed file from the servera machine to the workstation machine.
Use student as the password for the student user to authenticate to the servera machine.
[student@workstation ~]$scp student@servera:~/my-files.tar.xz ~/student@servera's password:studentmy-files.tar.xz
Create the Migrated Files directory.
[student@workstation ~]$ mkdir Migrated\ FilesExtract the contents of the my-files.tar.xz compressed file to the Migrated Files directory.
[student@workstation ~]$ tar --extract --xz --file my-files.tar.xz \
--directory ~/Migrated\ FilesVerify the contents of the Migrated Files directory.
[student@workstation ~]$ ls -l Migrated\ Files/
total 8
drwxr-xr-x. 2 student student 28 Nov 26 18:32 Calendar
drwxr-xr-x. 2 student student 59 Nov 26 18:32 Documents
drwxr-xr-x. 2 student student 73 Nov 26 18:32 Notes
drwxr-xr-x. 2 student student 84 Nov 26 19:06 Scripts
-rw-r--r--. 1 student student 4 Nov 26 18:57 service-pid.txt
-rw-r--r--. 1 student student 7 Nov 26 18:55 service-status.txt