www-data should be a user account.

main
Robert 2 years ago
parent a98d477c06
commit 1adf405d3e
  1. 16
      protected/README.MD

@ -12,10 +12,12 @@ Note: I use the greater-than sign > for the MySQL prompt commands.
Note: The apt-get package mgr is used by debian Linux like Ubuntu. Note: The apt-get package mgr is used by debian Linux like Ubuntu.
``` ```
## Make web group ## Make www-data system-user account
``` ```
# You'll want a web group to be created. # See if the account already exists?
$ sudo groupadd www-data $ id www-data
# If it says no such user, then:
$ sudo useradd --system --no-create-home --shell /usr/sbin/nologin www-data
``` ```
## Make a Regular user account, if only the root account exists currently. ## Make a Regular user account, if only the root account exists currently.
@ -53,17 +55,19 @@ $ sudo systemctl enable mysql
# Lets make a secure password for use with MySQL root account. # Lets make a secure password for use with MySQL root account.
$ MROOT=$(openssl rand -base64 18) $ MROOT=$(openssl rand -base64 18)
$ echo "MySQL Root password is now: $MROOT" $ echo "MySQL Root password is now: $MROOT"
# Copy this password to the clipboard
# The following script will prompt you to perform various security-related actions. Follow the prompts to set a root password, remove anonymous users, disallow root login remotely, remove the test database, and reload the privilege tables. # The following script will prompt you to perform various security-related actions. Follow the prompts to set a root password (Paste in the password from the clipboard), remove anonymous users, disallow root login remotely, remove the test database, and reload the privilege tables.
$ sudo mysql_secure_installation $ sudo mysql_secure_installation
# Lets make a secure password for use with MySQL user account EX zoombox. # Lets make a secure password for use with MySQL user account EX zoombox.
$ CMSPWD=$(openssl rand -base64 18) $ CMSPWD=$(openssl rand -base64 18)
$ echo "MySQL cms database user zoombox account password is now: $CMSPWD" $ echo "MySQL cms database user zoombox account password is now: $CMSPWD"
# Copy this password to the clipboard now
# Lets create a new user account for mysql # Lets create a new user account for mysql
$ mysql -u root -p$MROOT $ mysql -u root -p$MROOT
> CREATE USER 'zoombox'@'localhost' IDENTIFIED BY 'Enter_the_Password_for_user_zoombox_in_the_step_above_here'; > CREATE USER 'zoombox'@'localhost' IDENTIFIED BY 'Paste_IN_The_Password_for_user_zoombox_in_the_step_above_here';
> GRANT ALL ON cms.* TO 'zoombox'@'localhost'; > GRANT ALL ON cms.* TO 'zoombox'@'localhost';
> create database cms; > create database cms;
> exit > exit
@ -209,4 +213,4 @@ $ sudo systemctl restart apache2
If installed nginx: If installed nginx:
$ sudo certbot --nginx $ sudo certbot --nginx
$ sudo systemctl reload nginx $ sudo systemctl reload nginx
``` ```

Loading…
Cancel
Save