Centos7 configuration network connection, ssh tool connection settings and winscp file transfer

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.  

https://img-blog.csdn.net/20161008123201530?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

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.

https://img-blog.csdn.net/20161008123406762?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

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)

https://img-blog.csdn.net/20161008123807764?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

Then enable allow remote login

https://img-blog.csdn.net/20161008123926358?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

Finally, enable the use of username and password as connection authentication

https://img-blog.csdn.net/20161008124037166?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

Save file and exit

3. Start the sshd service and enter  sudo service sshd start

https://img-blog.csdn.net/20161008124204950?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

Check whether the sshd service has been started, enter ps -e | grep sshd

https://img-blog.csdn.net/20161008124257998?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

Or enter netstat -an | grep 22   to check    whether port 22 is open for listening.

https://img-blog.csdn.net/20161008124408719?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center

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.

Guess you like

Origin blog.csdn.net/i_likechard/article/details/88084805