- ssh root@123.45.67.890
Change root password
- passwd
Create new root-level superuser
- adduser demo
- passwd demo
Allow this user to run everything that root can
- visudo
# User privilege specificationChange SSH port, and disable remote root login
root ALL=(ALL) ALL
demo ALL=(ALL) ALL
- sudo vi /etc/ssh/sshd_config
Port 12345Reload SSH
PermitRootLogin no
AllowUsers demo
- systemctl reload sshd.service
New syntax for remote SSH (test this works before disconnecting from root session and rebooting!)
- ssh -p 12345 demo@123.45.67.890
Install Apache, PHP, MySQL (MariaDB)
- sudo yum install httpd mariadb-server mariadb php php-mysql
Start services and enable for auto-start
- sudo systemctl start httpd
- sudo systemctl enable httpd.service
- sudo systemctl start mariadb
- sudo systemctl enable mariadb.service
Root for Apache is /var/www/html, so you can test by creating a test file in there with this content
- <?php phpinfo();
Secure MariaDB
- sudo mysql_secure_installation
Add common PHP extensions, then restart Apache
- sudo yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel
- sudo systemctl restart httpd.service
Install FTP server (VSFTPD)
- sudo yum install vsftpd ftp -y
- sudo vi /etc/vsftpd/vsftpd.conf
Find and change this line from YES to NO
- anonymous_enable=NO
Enable auto-start and start
- sudo systemctl enable vsftpd
- sudo systemctl start vsftpd
references:
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-centos-6
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-centos-7
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-centos-6
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-centos-7
No comments:
Post a Comment