2. Q1. What is SSH? Explain in brief
SSH is the abbreviation for Socket Shell or Secure Shell. It is a protocol that is used to connect to a remote
server or system securely. It uses an SSH protocol as the data transfers between the client and the host are
encrypted. The primary role of the SSH command in Linux is to manage remote systems. Normally, this would
be another Linux system. However, it could also be a router, firewall, or even a computer with a different
operating system.
In a nutshell, SSH is a cryptographic network protocol used for an encrypted connection between a client and
a server.
Q2. How does SSH work?
To set up an SSH connection, we need two important components, a client and a host. The host can either be
a domain name, IP address, server, and more. The client uses the given host information to establish the
connection. If the credential provided is verified, an encrypted connection is established.
3. This technique of encryption generates a key for encrypting as well as decrypting. This key is distributed
among the hosts and clients to create a secure connection.
Q3. What is symmetric encryption?
Q4. What is asymmetric encryption?
Asymmetric encryption works on the principle of factoring in really large numbers. This technique
generates 2 keys called the private and public keys. The private key encrypts messages, while the public key
decrypts messages that are encrypted using the respective private key. This is kept with the client machine,
whereas the public key is distributed to other machines. The private key must always be kept a secret.
Otherwise, it will compromise the entire secure connection.
4. Q5. List a few file management commands and
explain their role.
Below is a list of various file management commands:
a. Pwd – displaying the current working directory
b. Cd – used for navigating through the file system
c. ls – used to list the contents of the directory
d. Touch – used to create a file
e. Cat – used to view a file
f. Mv – used to move a file
g. Cp – used to copy a file
h. Mkdir – used to create a directory
i. Rmdir – used to delete a directory
j. Rm – used to delete files
k. Find – used to locate a file in the filesystem
l. Wc – used to print count information of a file
5. We can list the contents of the file in a long listing by pairing the ls command with the option “-l”. By doing
so, the command prints out the following information: The file type, the file permissions, the number of hard
links to the file, file owner, file group, the file size, the date, time, and file name.
Q6. How do you list the contents of a file in a long listing?
Q7. How do you make the cp command ask before overwriting
a file?
When you use the cp command to copy the contents of a file into another existing file, it completely
overwrites the contents instead of appending. If at all you are not sure if the destination file exists already
and has contents you feel are important, you can make cp to prompt you to allow overwriting.
6. Q8. What is the fdisk command?
Fdisk is the abbreviation for “Fixed disk” or “Format disk”. The fdisk command manipulates partition tables
on the hard disk for Linux-based operating systems. Fdisk is also in MSDOS, Windows, IBM OS/2, Flex OS, and
many more.
Q9. What is the LSOF command?
LSOF is short for List of Open Files. This command retrieves details about various types of files opened by
different running processes. This command can not only list common or regular files but it can also perform
tasks like listing things like a shared library, a special file, a named pipe, a regular pipe, a character special file,
and many more.
7. The Chroot command changes the apparent root directory for the currently running process. In a nutshell,
chroot does one thing — It runs a command with a different root directory. Chroot does not make any
modifications to your disk. Nonetheless, it can make it appear that way from the POV of the processes
running under it. This command runs in such a modified environment that it cannot access files outside the
root directory.
Q10. What is chroot? Explain in brief