Redhat Chapter 2 Flashcards
is a text-based interface which can be used to input instructions to a computer system.
command line
The Linux command line is provided by a program called the _______
shell
The default shell for users in Red Hat Enterprise Linux is the __________.
GNU Bourne-Again Shell (bash)
is an improved version of one of the most successful shells used on UNIX-like systems, the Bourne Shell (sh).
Bash
When a shell is used interactively, it displays a string when it is waiting for a command from the user. This is called the _________.
shell prompt
When a regular user starts a shell, the default prompt ends with a ________ character
$
example:
[user@host ~]$
The $ character is replaced by a ________ character if the shell is running as the superuser, root.
#
example:
[root@host ~]#
The $ character is replaced by a # character if the shell is running as the superuser, ________.
root
The root is a __________ shell, which helps to avoid accidents and mistakes which can affect the whole system.
superuser
Using ________ to execute commands can be powerful.
bash
The bash shell provides a ________ language that can support automation of tasks.
scripting
The ________ has additional capabilities that can simplify or make possible operations that are hard to accomplish efficiently with graphical tools.
shell
The ________ shell is similar in concept to the command-line interpreter found in recent versions of Microsoft Windows, cmd.exe, although it has a more sophisticated scripting language.
bash
Administrators using the Apple Mac who use the Terminal utility may be pleased to note that ________ is the default shell in macOS.
bash
Shell Basics
Commands entered at the shell prompt have three basic parts:
- Command
- Options
- Arguments
is the name of the program to run.
- Command
- Options
- Arguments
Command
The command may be followed by one or more ________, which adjust the behavior of the command or what it will do. It normally starts with one or two dashes (-a or –all, for example).
- Command
- Options
- Arguments
Options
Commands may also be followed by one or more ________, which often indicate a target that the command should operate upon.
- Command
- Options
- Arguments
Arguments
Identify the command, option, and argument in the command (example):
usermod -L user01
Command:
usermod
Option:
-L
Argument:
user01
(The effect of this command is to lock the password of the user01 user account.)
To run the shell, you need to log in to the computer on a terminal ________.
terminal
A ________is a text-based interface used to enter commands into and print output from a computer system.
terminal
The computer might have a hardware keyboard and display for input and output directly connected to it. This is the Linux machine’s physical console ________.
physical console
The physical console supports multiple ________, which can run separate terminals and supports an independent login session.
virtual consoles
You can switch between virtual consoles by pressing ________ and a function key (F1 through F6) at the same time.
Ctrl+Alt
The computer might provide a graphical login prompt on one of the virtual consoles. You can use this to log in to a ________.
graphical environment
In Red Hat Enterprise Linux 8, if the graphical environment is available, the login screen will run on the first virtual console, called ________. Five additional text login prompts are available on virtual consoles two through six.
tty1
Many system administrators choose not to run a graphical environment on their servers. This allows resources which would be used by the graphical environment to be used by the server’s services instead. (True or False)
T
is a menu item used to switch users in the graphical environment without logging out
Switch User
When you log out of a graphical environment, it will exit and the ________ will automatically switch back to the graphical login screen on the first virtual console.
physical console
In Red Hat Enterprise Linux 6 and 7, the graphical login screen runs on the first virtual console, but when you log in your initial graphical environment ________ the login screen on the first virtual console instead of starting on a new virtual console.
- hides
- replaces
- removes
- opens
replaces
In Red Hat Enterprise Linux 5 and earlier, the first six virtual consoles always provided ________ prompts.
text login
If the graphical environment is running, it is on virtual console seven (accessed through ________ ).
Ctrl+Alt+F7
A ________ server does not have a keyboard and display permanently connected to it.
headless
A ________ may be filled with many racks of headless servers, and not providing each with a keyboard and display saves space and expense.
data center
To allow administrators to log in, a headless server might have a login prompt provided by its ________, running on a serial port which is connected to a networked console server for remote access to the serial console.
serial console
would normally be used to fix the server if its own network card became misconfigured and logging in over its own network connection became impossible.
serial console
In a modern computing environment, many ________ are actually virtual machines or are running as public or private cloud instances.
headless servers
In Linux, the most common way to get a shell prompt on a remote system is to use ________.
Secure Shell (SSH)
Most Linux systems (including Red Hat Enterprise Linux) and macOS provide the OpenSSH command-line program ________ for aquiring a shell prompt.
ssh
In this example, a user with a shell prompt on the machine host uses ssh to log in to the remote Linux system remotehost as the user remoteuser:
[user@host ~]$ ssh remoteuser@remotehost
remoteuser@remotehost’s password: password
[remoteuser@remotehost ~]$
The ________ command encrypts the connection to secure the communication against eavesdropping or hijacking of the passwords and content.
ssh
Some systems (such as new cloud instances) do not allow users to use a password to log in with ssh for tighter security. (True or False)
T
An alternative way to authenticate to a remote machine without entering a password is through ________.
public key authentication
With public key authentication method, users have a special identity file containing a ________, which is equivalent to a password, and which they keep secret.
private key
Their account on the server is configured with a matching public key, which does not have to be secret.
When logging in, users can configure ________ to provide the private key and if their matching public key is installed in that account on that remote server, it will log them in without asking for a password.
ssh
When logging in, users can configure ________ to provide the private key and if their matching public key is installed in that account on that remote server, it will log them in without asking for a password.
ssh
Example (using ssh command):
a user with a shell prompt on the machine host logs in to (remotehost) as (remoteuser) using ssh, using public key authentication. The (-i) option is used to specify the user’s private key file, which is (mylab.pem). The matching public key is already set up as an authorized key in the (remoteuser) account.
(First line)
[user@host ~]$ ssh -i mylab.pem remoteuser@remotehost
(Second line)
[remoteuser@remotehost ~]$
For this to work, the private key file must be readable only by the user that owns the file. In the preceding example, where the private key is in the mylab.pem file, the command chmod 600 mylab.pem could be used to ensure this. How to set file permissions is discussed in more detail in a later chapter.
Each time you connect to a remote host with ssh, the remote host sends ssh its ________ to authenticate itself and to help set up encrypted communication.
host key
The ssh command compares that against a list of saved host keys to make sure it has changed. (True of False)
The ssh command compares that against a list of saved host keys to make sure it has not changed.
In SSH, ________ protect against man-in-the-middle attacks, these host keys are unique for each server, and they need to be changed periodically and whenever a compromise is suspected.
host keys
The ssh command compares that against a list of saved host keys to make sure it has not changed. If the host key has changed, this might indicate that someone is trying to pretend to be that host to hijack the connection which is also known as ________.
man-in-the-middle attack
If the local machine does have a host key saved and it does not match the one actually sent by the remote host, the connection will automatically be ________ with a warning.
closed
When you are finished using the shell and want to quit, you can choose one of several ways to end the session. You can enter the ________ command or press _______ to terminate the current shell session
- exit
- Ctrl+D
The following is an example of a user logging out of an SSH session:
[remoteuser@remotehost ~]$ exit
logout
Connection to remotehost closed.
[user@host ~]$
Which term describes the interpreter that executes commands typed as strings?
A) Command
B) Console
C) Shell
D) Terminal
C) Shell
Which term describes the visual cue that indicates an interactive shell is waiting for the user to type a command?
A) Argument
B) Command
C) Option
D) Prompt
D) Prompt