VPS User Configuration for Ubuntu

Source: Internet
Author: User
Tags chmod vps ssh port

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.