RHCSA Rapid Track
In this exercise, you will create hard links and symbolic links and compare the results.
Outcomes
You should be able to create hard links and soft links between files.
Log in as the student user on workstation using student as the password.
On workstation, run the lab files-make start command.
This command runs a start script that determines if the servera host is reachable on the network and creates the files and working directories on servera.
[student@workstation ~]$lab files-make start
Use the ssh command to log in to
serveraas thestudentuser. The systems are configured to use SSH keys for authentication, and therefore a password is not required.[student@workstation ~]$ssh student@servera...output omitted...[student@servera ~]$Create a hard link named
/home/student/backups/source.backupfor the existing file,/home/student/files/source.file.View the link count for the file,
/home/student/files/source.file.[student@servera ~]$ls -l files/source.filetotal 4 -rw-r--r--.1student student 11 Mar 5 21:19 source.fileCreate a hard link named
/home/student/backups/source.backup. Link it to the file,/home/student/files/source.file.[student@servera ~]$ln /home/student/files/source.file \/home/student/backups/source.backupVerify the link count for the original
/home/student/files/source.fileand the new linked file,/home/student/backups/source.backup. The link count should be2for both files.[student@servera ~]$ls -l /home/student/files/-rw-r--r--.2student student 11 Mar 5 21:19 source.file[student@servera ~]$ls -l /home/student/backups/-rw-r--r--.2student student 11 Mar 5 21:19 source.backup
Create a soft link named
/home/student/tempdirthat points to the/tmpdirectory onservera.Create a soft link named
/home/student/tempdirand link it to/tmp.[student@servera ~]$ln -s /tmp /home/student/tempdirUse the ls -l command to verify the newly created soft link.
[student@servera ~]$ls -l /home/student/tempdirlrwxrwxrwx. 1 student student 4 Mar 5 22:04 /home/student/tempdir -> /tmp
Exit from
servera.[student@servera ~]$exitlogout Connection to servera closed. [student@workstation ~]$