New server initialization

 

1. Change password

ssh [email protected]

passwd //Use a random password string

Important Servers use public/private keys, turn off password login

 

2. Set up user groups

groupadd development

useradd -g development develop

passwd develop // Preset 123456, and then let individuals set their own passwords after logging in

chage -d 0 zhaozhonglin // Force individual to set the password after logging in

usermod -U zhaozhonglin

 

3. The production machine prohibits ROOT remote SSH login: 

vi /etc/ssh/sshd_config

Change PermitRootLogin yes to no

service sshd restart //Restart the sshd service

 

Log in with the ordinary user uploader for remote management, and then use su root to switch to the root user

 

【mysql】
CREATE USER 'username'@'host' IDENTIFIED BY 'password';
GRANT ALL ON *.* TO 'username'@'host';

//Note: The user authorized by the above command cannot authorize other users. If you want the user to be authorized, use the following command:

//   GRANT ALL ON databasename.tablename TO 'username'@'host' WITH GRANT OPTION;

 

// reset Password

SET PASSWORD FOR 'pig'@'%' = PASSWORD("123456");

 

// Revoke user permission
REVOKE ALL ON *.* FROM  'pig'@'%' ;

// delete users

DROP USER 'username'@'host';

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326751885&siteId=291194637