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

Mysql solution to improve the efficiency of copying large data tables

Preface This article mainly introduces the releva...

CSS3 simple cutting carousel picture implementation code

Implementation ideas First, create a parent conta...

MySQL 5.7.31 64-bit free installation version tutorial diagram

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

Input file custom button beautification (demo)

I have written such an article before, but I used...

Pure CSS to achieve the effect of picture blinds display example

First, let me show you the finished effect Main i...

Docker deployment springboot project example analysis

This article mainly introduces the example analys...

CSS3 realizes the graphic falling animation effect

See the effect first Implementation Code <div ...

A brief discussion on VUE uni-app custom components

1. Parent components can pass data to child compo...

How to solve the problem of automatic package update in Debian system

I don't know when it started, but every time ...

Using text shadow and element shadow effects in CSS

Introduction to Text Shadows In CSS , use the tex...