![]() ![]() New password: (type a password, press Enter) sudo mysql_secure_installationĮnter current password for root (enter for none): (press Enter)Ĭhange the root password? (press Enter) Prepare the MariaDB server, and configure its root account. Php-intl php-bz2 php-imagick Configure MariaDB sudo apt -y install php-curl php-gd php-mbstring php-zip php-xml php-mysql \ Install the PHP modules required by Nextcloud. sudo apt -y install apache2 mariadb-server php Install the Apache web server, the MariaDB database system, and the PHP scripting language. Firewall is active and enabled on system startup Install web server, database, and PHP sudo ufw enable Command may disrupt existing ssh connections. ![]() sudo ufw allow ssh sudo ufw allow http sudo ufw allow httpsĮnable the firewall, putting these rules into effect. Then, create exceptions to allow incoming traffic for SSH (port 22), HTTP (port 80), and HTTPS (port 443) connections. sudo ufw default allow outgoing sudo ufw default deny incoming Configure the firewall to allow all outgoing traffic, and deny all incoming traffic. To help secure your server, use the utility ufw ("Uncomplicated Firewall") to restrict access to specific network ports.įirst, set broad default rules. sudo systemctl restart sshd Configure VPS firewall Restart the SSH server to load the new settings. Save the file by pressing Ctrl+ O, Enter. In the text editor, use the arrow keys to locate the line that says PermitRootLogin yes. The sshd_config file requires administrator privileges to edit, so you must prefix the nano command with sudo, and enter your password (not the root password) when prompted. In these examples, we use the nano text editor. Open the file /etc/ssh/sshd_config in a text editor. You should always disable root SSH logins as soon as possible after creating a VPS. The following steps ensure that no one (including you) can log in to the server as root. It's dangerous to allow SSH logins by the root user, because your VPS is exposed to the Internet, and it can receive many unwanted login attempts. This indicates you are logged in as a regular user, instead of root. that instead of a #, the prompt ends in a $. You're greeted by the regular user prompt. Log in to the server again, this time as your new user. (Substitute with your actual domain name.) hostnamectl set-hostname Set the hostname of your computer to your domain name. Usermod lets you run the sudo command, so you can run administrator commands without logging in as root. Use the usermod command to add your user to the sudo group. Retype new UNIX password: (type it again and press Enter) ![]() Enter new UNIX password: (type a password and press Enter) adduser myuserĪnswer the prompts as follows. In this example, we'll name the user myuser. For example, if your name is Alice, you could choose the username alice. Choose a one-word name with lowercase letters. apt update & apt -y upgradeĬreate a regular (non-root) user account. ![]() the system using the apt package manager. When you log in, you'll see the command prompt for your server. Warning: Permanently added '198.74.58.146' to the list of known hosts. You'll then be prompted for the root password of your VPS. The authenticity of host ' (123.45.67.89)' can't be established.ĮCDSA key fingerprint is SHA256:asdfPZq159216hjklgRBhD412b3PvkEjKBf0h352mZp.Īre you sure you want to continue connecting (yes/no)? If this is the first time you're connecting to the server, you'll be asked to verify the authenticity of the server's encryption key. If you can't connect using your domain name, use your IP address instead. If you recently updated your DNS records, the information may not yet have propagated to your DNS servers. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |