# Vi/etc/sysconfig/network-scripts/ifcfg-eth0
Device = eth0 # describe the device alias for the NIC, for example, it is eth0 in the ifcfg-eth0 File
onboot = yes # whether to set this network interface when the system starts. If yes, activate this device when the system starts
Device = "eth0"
Hwaddr = "08: 00: 27: DB: 77: 6f"
Nm_controlled = "yes"
Onboot = "yes"
Bootproto = "DHCP"
1. Set the network connection mode of the VM to bridge.
A: Modify the SSH configuration file.
Root @ sample ~] # Vi/etc/ssh/sshd_config using VI to open the SSH configuration file
# Protocol locate this row and delete the line header "#". Then, delete ", 1" at the end of the line, and only allow connections in SSH2 mode.
Bytes
The Protocol 2 protocol changes to this status after modification. Only SSH2 is used.
# Serverkeybits 768 rows find this line, remove "#" at the beginning of the line, and change 768 to 1024
Bytes
Changed serverkeybits 1024 bytes to this status, and changed the serverkey strength to 1024 bits.
# Permitrootlogin Yes locate this line, remove "#" at the beginning of the line, and change "yes" to "no ".
Bytes
Permitrootlogin no logs is changed to this status and cannot be logged on using root.
# Passwordauthentication Yes locate this line and change Yes to no
Bytes
Passwordauthentication No. login is changed to this status, and password-based logon is not allowed.
# Permitemptypasswords no longer find this row and delete the line header "#". Empty Password Logon is not allowed.
Bytes
Permitemptypasswords No. Changed to this status. Do not log on with a blank password.
Save and exit
B: restart the SSH service.
Note that the absolute path must be used here.
Root @ sample ~] #/Etc/rc. d/init. d/sshd restart the SSH server
Stopping sshd: [OK]
Starting sshd: [OK] the restart SSH server is successfully restarted.
View IP
Ifconfig | less