Use of chmod
chmod (option) (parameter)
Options:
-C or--changes: The effect is similar to the "-V" parameter, but returns only the part of the change;
-F or--quiet or--silent: No error message is displayed;
-R or--recursive: recursive processing, all files and subdirectories under the instruction directory are processed together;
-V or--verbose: Displays the instruction execution process;
Parameters:
Permission mode: Specifies the permission mode of the file, 3-bit represents the user rights of the owning group, the other person's rwx permission
File: The file to change permissions for.
such as: Chmod-r Mydir
Ubuntu User Management
#创建用户:
Useradd MyUser
#修改密码:
passwd MyUser
#建立文件夹:
Mkdir/home/myuser
#设置文件夹权限:
Chmod-r 700/home/myuser
#修改shell为bash:
Usermod-s/bin/bash MyUser
#设置文件夹所有者:
Chown-r Myuser:myuser/home/myuser
#添加用户到sudo:
Usermod-ag sudo myuser
Installing Fail2ban Software
This software will use the Iptables firewall, will attempt to blast the SSH password IP blocking, the default of 10 minutes, so as to effectively prevent attacks.
Apt-get Install Fail2ban
Login shell with Public key
Vim/home/myuser/.ssh/authorized_keys
#或者
Cat Mypublickey.pub >> Authorized_keys
chmod 400/home/myuser/.ssh/authorized_keys
Use of the UFW firewall
#安装:
sudo apt-get install UFW
UFW Allow SSH
UFW Allow HTTP
UFW Allow HTTPS
You can also use the port to open
UFW Allow 53
Be sure to open the SSH port, if you are not the standard port, please remember to open, otherwise the consequences!
UFW Enable
Two-factor authentication
On the left side of the control panel of the bricklayer is
Installing Apache
sudo apt-get install apache2
Sudo/etc/init.d/apache2 restart
Just put the designed HTML file into the/var/www directory
Modifying the default folder will have permissions issues and is not recommended to modify
VPS User Configuration for Ubuntu