Chapter 5 - Connecting to Redhat Enterprise Linux Flashcards

1
Q

What is a terminal?

A

A terminal is an environment that is opened on the console and provides access to a text shell, which is the command-line environment that can be used to type commands.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a console?

A

a console as the environment the user is looking at. That means that the console is basically what you see when you are looking at your computer screen.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the difference between a console and terminal?

A

In a textual environment, the words console and terminal are more or less equivalent. In a graphical environment, they are not. Think of it like this: You can
have multiple terminals open on a console, but you cannot have multiple consoles open in one terminal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How to work with multiple terminals in a graphical environment?

A

As an administrator, youcan open several terminal windows, and in each terminal window you can use the su - command to open a shell in which you can work with a different user identity.
This allows you to easily test features and see the results of these tests immediately

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to work with multiple terminals in a non-graphical environment?

A

In a nongraphical environment, you only have one
terminal interface that is available and that makes working in different user shell environments a bit more difficult. For this purpose we use virtual terminals. This feature allows you to open six different terminal windows from the same console at the same time and use
key sequences to navigate between them. To open these terminal windows, you can use the key sequences Alt-F1 through Alt-F6

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a virtual terminal in linux?

A

To offer an option that makes working from several consoles on the same server possible, Linux uses the concept of a virtual terminal. This feature allows you to open six different terminal windows from the same console at the same time and use key sequences to navigate between them

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the different virtual consoles available in linux?

A

To open/switch between virtual terminal windows, you can use the key sequences Alt-F1 through Alt-F6
F1: Gives access to the GNOME Display Manager (GDM) graphical login
F2: Provides access to the current graphical console
F3: Gives access back to the current graphical session
F4–F6: Gives access to nongraphical consoles

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the command command enables you to switch to a different virtual environment directly from the current environment?

A

chvt command

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Where are the corresponding device files for the virtual consoles?

A

virtual consoles corresponding device file in the
/dev directory. virtual consoles have
corresponding device files, which are numbered “/dev/tty1” through “/dev/tty6”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

When switching between the virtual consoles, what is the difference between Alt-F6 and Ctrl-Alt-F6 key sequences

A

Alt-F6 and Ctrl-Alt-F6 key sequences are essentially the same. It is important to use the Ctrl key as well when going from a GUI to a text environment. To go back from the text environment to the GUI environment, using the Ctrl key is optional.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Where are the corresponding device files for terminal windows opened in a graphical environment?

A

For terminal windows that are started from a graphical environment, pseudo terminals are started. These pseudo terminals are referred to using numbers in the
“/dev/pts” directory. So, the first terminal window that is started from a graphical environment appears as /dev/pts/1, the second terminal windows appears as
/dev/pts/2, and so on.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are some serious scenarios when linux system has to be rebooted?

A
  • To recover from serious problems such as server hangs and kernel panics
  • To apply kernel updates
  • To apply changes to kernel modules that are being used currently and therefore cannot be reloaded easily
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Why do you lose data when a linux server is just stopped by pulling the power plug?

A

That is because processes that have written data do not typically write that data directly to disk, but instead store it in memory buffers (cache) from where it is committed to disk when it is convenient for the operating system. When a server is rebooted, all processes that are running need to shut down properly. But this does not happen when you pull off the power plug

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What happens when you issue a proper reboot of a Linux system?

A

To issue a proper reboot, the systemd process has to be alerted. The systemd process is the first process that was started when the server was started, and it is responsible for managing all other processes, directly or indirectly. As a result, on system reboots or halts, the systemd process needs to make sure that all these processes are stopped

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the commands to perform a proper reboot or a proper shutdown?

A

systemctl reboot or reboot
systemctl halt or halt
systemctl poweroff or poweroff

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the difference between halt and poweroff command?

A

The difference between these two commands is thatthe systemctl poweroff command talks to power management on the machine to shut off power on the machine. This often does not happen when using systemctl halt

17
Q

Which command to use to force a linux machine to reset?

A

echo b > /proc/sysrq-trigger
This command immediately resets the machine
without saving anything. Notice that this command should be used only if there are no other options!

18
Q

What is Secure Shell or SSH?

A

Secure Shell is the common method to gain access

to other machines over the network

19
Q

What service and what port has to be running for SSH to work?

A

sshd service must be running and offering services at
port 22, and it should not be blocked by the firewall. The ssh command by default tries to reach the sshd process on the server port 22

20
Q

Which option to use to specify the port with SSH command?

A

“ssh -p” followed by the port number you want to connect to

21
Q

What is the command if you want to establish

an SSH session as user root to a remote server

A

ssh root@remoteserver
or
ssh remoteserver -l root

22
Q

[root@server1 ~]# ssh 192.168.4.220 -l root
The authenticity of host ‘192.168.4.220 ()’ can’t be established.
ECDSA key fingerprint is 35:64:36:f8:ac:4f:8a:94:aa:6e:4b:85:ed:76:0a:eb.
Are you sure you want to continue connecting (yes/no)?

^ What is the above warning/error message you are seeing?

A

The security message is displayed because the remote server has never been contacted before and therefore there is no way to verify the identity of
the remote server. After connecting to the remote server, a public key fingerprint is stored in the file “~/.ssh/known_hosts”

23
Q

which option to use with SSH command to enable support for graphical applications?

A

-Y option. Example : ssh -Y linda@server2

24
Q

Which is the secure way of transferring files between two linux systems?

A

scp command. The scp command is similar to the cp command, which is used to copy local files,

25
Q

Which command. tobe used to synchorinize files between two linux systems?

A

rsync command

26
Q

How to specify the port with the SCP command?

A

scp -P

27
Q

Which is the other command besides scp or cp which can be used to securely transfer files?

A

sftp

28
Q

How does SFTP file transfering work?

A

When working with sftp, you open an FTP client session to the remote server, where the only requirement on the remote server is that it should be running the sshd process. From the FTP client session, you use typical FTP client options, like put to upload a file or get to download a file.

29
Q

Which command uses SSH to synchronize files between a remote directory and a local directory

A

rsync

30
Q

Which command to use to generate a key pair?

A

ssh-keygen

31
Q

Which command is used to copy the public key over to the remote server?

A

ssh-copy-id

Example : ssh-copy-id server2 - to copy to server2 the public key you have just created