FAlinux basic 02

A network configuration

Network card type

IP address acquisition method dhcp or none=static default none

NAME

DEVICE

(HWADDR=) mac address

boot

ip address

Subnet mask NETMASK

Gateway

DNS1

DNS2

QQ screenshot 20210116141906.png

systemctl restart network restart network

services network restart (command before 7)

route -n routing table to see if the gateway takes effect

cat /etc/resolv.conf DNS automatically generated

ifconfig

ip a =ip appr list view all network cards

Two modify the host name

hostnamectl set-hostname it101 takes effect immediately

vim /etc/hostname can also modify the file

Configure the hosts file to access the corresponding computer without DNS

vim /etc/hosts ip address corresponds to the name of the computer  

192.168.1.1 zl

Three planning tasks 

crontab periodic scheduled task blank space

Minute time day month week (0 and 7 are Sundays / every-to, and)

*/5 10-18 1-5,8 * * /data/backup.sh command The day and the week conflict, do not write at the same time

crontab -e edit scheduled task

crontab -l view scheduled tasks  

crontab -r delete scheduled task

Absolute path is required for commands or files  

/etc/cron/deny plan permission denied   

Four SSH management  

  1. The openssh-server openssh-clients package is installed by default to release the ssh protocol

    systemctl status sshd View service status enabled boot operation

    systemctl stop sshd

    systemctl restart sshd

    systemctl enable sshd starts automatically at boot

    systemctl disable sshd does not start at boot

    netstat -tulnp |grep :22/sshd

    View listening port

    /etc/services View the relationship between services and ports

  2. ssh [email protected] remote connection

    scp test.txt [email protected]:/root remote copy -r copy folder

  3. Password-free login, key login ssh mutual trust

    ssh-keygen generates public and private keys is_rsa id_rsa.pub

    ssh-copy-id -i /root/.ssh/id_rsa.pub 192.168.6.31 target ip

    The target end /etc/ssh/sshd_config can be changed ssh port port changed to -p

    Line 49 can ssh root be allowed to log in

    79-line password login permission

    129 Check DNS default xshell connection slow changed to no

Five process management PID is not fixed 

ps aux |more Process management? The process that runs before the system boots and logs in to the interface

ps -ef 

End of process

kill -15 pid -15 can be omitted by default

kill -9 

15 Normal end 9 Forced end


Guess you like

Origin blog.51cto.com/14234935/2593267