May 26, 2019 in respect of such -linux school - Lesson 11

Chapter 9 remote host using ssh service management

9.1 Configuring Network Services
9.1.1 configure network parameters --nmtui
(1) NIC configuration file ONBOOT yes, so after a system reboot card was activated.
(2) Restart Service Manual: systemctl the restart Network;
9.1.2 Create network session - the network session function allows the user to quickly switch in the plurality of profiles.
nmcli-- command line-based network configuration tool for managing NetworkManager service.
(1) check the network connectivity: nmcli Connection Show;
(2) arranged company network session: nmcli the Add Connection-CON company name ifname eno16777736 autoConnect NO Ethernet type IP4 192.168.10.10 GW 4 192.168.10.1
(. 3) arranged house network session: nmcli connection add con-name house ifname eno34888840 type ethernet (4) View network session: nmcli connection show
Note: use nmcli command-configured network session is permanent effect.
9.1.3 Binding two NIC
(1) was added card; (2) edit parameter card 1; (3) Edit Parameter card 2; (4) bond0 device name (device has a fixed bond0 only after binding edit 0 IP address);
(5) create NIC teaming drivers: vim /etc/modprobe.d/bond.conf
Alias bond0 bonding
bond0 miimon the MODE = 100 Options = 6
(6) Network Service Restart: systemctl restart Network;
9.2 remote service --SSH- in a secure manner to provide remote login protocol, is now the preferred way to remotely manage the linux.
9.2.1 Configuring sshd service is based on the SSH protocol --sshd the development of a remote management service program, can provide two kinds of secure authentication methods.
(1) password-based authentication: The account login and password to authenticate.
(2) based on the authentication key: locally generated key pair, and the public key of the key pair uploaded to the server, and compared with the public key of the server, which is relatively safe manner.
Step 1: Generate a client machine "key" --- ssh-keygen;
Step: client host transmits the generated public key file to the remote host: --- ssh-copy-id 192.168 .10.10;
the third step: to configure the server so that only key authentication, password authentication reject conventional; ssd_config line 78.
Step Four: Save the configuration and restart the service: systemctl restart sshd;
Step five: Login: ssh 192.168.10.10.
sshd service master configuration file: / etc / SSH / the sshd_config:
(. 1) remote registration allowing administrators: line 48: the PermitRootLogin NO;
(2) to configure the server to prohibit password login, allowing only the key registration: line 78 NO PasswordAuthentication
(3) after the configuration you want to restart the service: systemctl restart sshd;
(4) the service will be configured to start adding items: systemctl enable sshd;
RHEL7 already installed and enabled by default sshd service.
Remote connection: ssh 192.168.10.10
9.2.3 remote transmission command --scp (secure copy) - scp ssh-based protocol is encrypted transmission between the different hosts of the network.
(1) to transfer files to the remote host: scp [parameters] local file remote account @ Remote IP address: remote directory.
For example: SCP /root/readme.txt 192.168.10.10: / Home
(2) to download the file on the remote host to the local host: SCP [parameters] @ remote IP address of the remote user: Remote File local directory
for example: scp 192.168.10.10 : / etc / reahat-Release / root;
9.3 sessions uninterrupted service --- screen: an open source remote control enables multi-window, can simultaneously control multiple remote terminal window. RHEL7 not installed by default screen service program, you need to configure YUM repositories to install it.
Action: (1) session recovery; (2) multi-window; (3) session sharing;
9.3.0 installation screen program
(1) virtual machine CD / DVD disc option to "Use ISO image file";
(2) create the directory and mount: mddir -p / Media / cdrom; Mount / dev / cdrom / Media / cdrom;
(3) create a YUM repository configuration file: vim /etc/yum.repos.d/rhel7.repo:
[rhel7]
name = rhel7
baseurl=file:///media/cdrom
enabled=1
gpgcheck=0
(4) 安装screen:yum install screen

9.3.1 Remote Management Session
(1) create a session window saying: screen -S aa (session name);
(2) shows the current existing session window: Screen -ls;
(3) to recover the specified session window: screen -r session name
(4) to exit the session window: exit;
(. 5) run to run directly use the screen command: for example: screen vim memo.txt, so that all operations in the command will be recorded, after the command screen session It will automatically end.
9.3.2 Session sharing
(1) A management client connected to the server: SSH 192.168.10.10;
(2) the client A creates a session: screen -S linuxprobe (Example);
(3) Client B registration server: ssh 192.168. 10.10;
(4) obtaining remote session client B: screen -x;

May 26, 2019 in respect of such -linux school - Lesson 11May 26, 2019 in respect of such -linux school - Lesson 11May 26, 2019 in respect of such -linux school - Lesson 11

Guess you like

Origin blog.51cto.com/14265779/2403285