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

Vue project @change multiple parameters to pass multiple events

First, there is only one change event. changeleve...

How to use CSS media query aspect-ratio less

CSS media query has a very convenient aspect rati...

Detailed explanation of how to use Vue to load weather components

This article shares with you how to use Vue to lo...

MySQL 5.7.23 decompression version installation tutorial with pictures and text

Download the MySQL installer Official download ad...

Why Google and Facebook don't use Docker

The reason for writing this article is that I wan...

Detailed explanation of data sharing between Vue components

Table of contents 1. In project development, the ...

An example of using Lvs+Nginx cluster to build a high-concurrency architecture

Table of contents 1. Lvs Introduction 2. Lvs load...

Summary of MySQL development standards and usage skills

1. Naming conventions 1. Database names, table na...

Writing tab effects with JS

This article example shares the specific code for...

How to use environment variables in nginx configuration file

Preface Nginx is an HTTP server designed for perf...

MySQL Query Cache and Buffer Pool

1. Caches - Query Cache The following figure is p...

Vue custom encapsulated button component

The custom encapsulation code of the vue button c...