Private computer private environment configuration centos connection network
Ip addr
Display LAN IP address
Modify the network card configuration file. The network connection is open.
cd /etc/sysconfig/network-scripts/
vi ifcfg-ens33
Change noboot to yes. Press ESC, colon, wq, enter to save and exit. Wq! Force save and exit. qExit.
Restart the network service.
service network rstart
ping baidu.com
The display is ok.
Computer company environment configuration centos system connection network
The operation is almost the same as above. Generally, companies will bind mac and ip
At this time, you need to use ip addr to record the mac address. Give the network administrator the mac address to ask for permission. Some companies only require a mac address, and some require a mac and then assign you an IP. For the former, you can add or modify HwAddr, ipaddr0, gateway0, dns1, dns2, and bootproto in network-scripts yourself.
TYPE=Ethernet
BOOTPROTO=static #Enable static IP address
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=ens33
UUID=bc5cb577-3a60-4859-9754-a5880d74bb21
ONBOOT=yes #Turn on automatic network connection
HWADDR=00:0C:24:81:7A:15
IPADDR0=192.168.1.15 #Set IP address
PREFIXO0=24 #Set subnet mask
GATEWAY0=192.168.1.1 #Set gateway
DNS1=8.8.8.8 #Set the primary DNS
DNS2=8.8.4.4 #Set up DNS
:wq! #Save and exit
Ping baidu.com
Ssh connection, centos side settings
In the virtual machine (Vmware Workstation), CentOS7 is installed, and now I want to connect to CentOS7 in the virtual machine through the SSH tool.
1. First, make sure CentOS7 has openssh-server installed. Enter yum list installed | grep openssh-server in the terminal.
It shows that openssh-server has been installed . If there is no output, it means that openssh-server is not installed . Enter yum install openssh-server.
To install openssh-server
2. Find the sshd service configuration file sshd_config in the /etc/ssh/ directory and open it with the Vim editor
Remove the # sign before the listening port and listening address in the file.
(Remarks: Enter vim text, press "i" to start editing. After editing, press "esc" to return to the command mode, enter ":wq", press Enter to save and exit, ":wq!", press Enter to force save and exit. Exit; ":q", exit without saving any changes)
Then enable allow remote login
Finally, enable the use of username and password as connection authentication
Save file and exit
3. Start the sshd service and enter sudo service sshd start
Check whether the sshd service has been started, enter ps -e | grep sshd
Or enter netstat -an | grep 22 to check whether port 22 is open for listening.
Connect to the centos host through CRT on another computer and operate remotely
Download secureCRT. Any version.
Install on any computer that needs to remotely operate the server
By default, ssh2 connection is used. Enter the server IP, port 22 is used by default. After clicking Confirm, follow the prompts to enter the server account (if no new account is created, the default account name is root) and password.
Click Confirm to connect.
At this point, it can be operated on the crt. Advantages of Crt, support copying and pasting (right click).
Manipulate server files on the visual interface through winscp
Download any version of winscp.
Install it on any computer that needs to configure the server remotely, and you can quickly create and copy files to the server.
Just install it by default.
Open the software and use the default sftp protocol. Enter the server IP. The default port number is 22. Enter the server account and password. After clicking Confirm, click Save Key. You can enter the visual server file operation interface. Copying files is very convenient.