Introduction to RHCE bridging, password-free login and port number modification

Introduction to RHCE bridging, password-free login and port number modification

1. Configure bridging and capture packets for verification

Bridging is to connect several network interfaces on a machine. As a result, the messages received by one of the network cards will be copied to other network cards for sending. So that the messages between network ports can be forwarded to each other.

1. Create a bridge device and session

[root@lyzyyds ~]# nmcli c add type bridge con-name bridge1 ifname bridge1 ipv4.addresses 192.168.233.181/24 ipv4.gateway 192.168.233.2 ipv4.dns 8.8.8.8 ipv4.method manual
Connection 'bridge1' (cff2b8f4-c6cd-4424-ae4d-d2a0af6526ba) successfully added.
successfully indicates that the configuration is successful

#Configure the IP address, gateway, dns and address acquisition method of the software bridge network card

2. Add devices and sessions to the bridge device

[root@lyzyyds ~]# nmcli c add type bridge-slave con-name brideg1_port1 ifname ens160 master bridge1
Connection 'brideg1_port1' (b615a309-bf5d-4aa7-b7cb-8a4d86a94074) successfully added.
successfully means adding successfully

3. Start slave device session and bridge session

[root@lyzyyds ~]# nmcli c up brideg1_port1 Start from device

[root@lyzyyds ~]# nmcli c up bridge1 Bridge startup

Packet capture verification

There is ICMP of ens160, which means that our bridge is successfully built and ens160 is accessed through the bridge.

2. Implement password-free login

First, make sure you have two virtual machines

One of them has an IP of 162.168.233.220

Log in to this 220 in another virtual machine

Generate a public key: Public key: id_rsa.pub

Put our key in authorized_keys

Log in to the virtual machine 220 again to log in without password

3. Modify the login port: 22-》2222

First enter this configuration file

4. Do not allow root users to log in remotely

First, you need to enter ssh

5. Create user sshuser1 and set a password, and only allow sshuser1 to log in remotely via ssh

First create a new user and add a password

Change PermitRootLogin's yes to no

Then restart the service

Then I connected with ssh and found that the root user could not log in, but I could connect by connecting to sshuser1

This is the end of this article about RHCE bridging, password-free login and port number modification. For more information about RHCE bridging, password-free login and port number modification, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Detailed explanation of setting static IP in virtual machine Linux bridge mode

<<:  MySQL joint index effective conditions and index invalid conditions

>>:  How to implement h5 input box prompt + normal text box prompt

Recommend

Detailed explanation of Linux mpstat command usage

1. mpstat command 1.1 Command Format mpstat [ -A ...

MySQL common statements for viewing transactions and locks

Some common statements for viewing transactions a...

Modify the default scroll bar style in the front-end project (summary)

I have written many projects that require changin...

Detailed explanation of MySQL 8.0.18 commands

Open the folder C:\web\mysql-8.0.11 that you just...

Two ways to implement HTML to randomly drag content positions

Test: Chrome v80.0.3987.122 is normal There are t...

MySQL 5.7.21 winx64 installation and configuration method graphic tutorial

This article summarizes the notes for installing ...

Tutorial on installing nginx in Linux environment

Table of contents 1. Install the required environ...

MySQL 5.7.31 64-bit free installation version tutorial diagram

1. Download Download address: https://dev.mysql.c...

Docker modifies the configuration information of an unstarted container

When I first used docker, I didn't use docker...

How to check if a table exists in MySQL and then delete it in batches

1. I searched for a long time on the Internet but...

A Brief Analysis of Patroni in Docker Containers

Table of contents Create an image File Structure ...