-
Notifications
You must be signed in to change notification settings - Fork 0
notebook
users who belong to the “wheel” group are allowed to use the sudo command.
Disallow remote SSH access to the root account.
in /etc/ssh/sshd_config
PermitRootLogin no
systemctl reload sshd
Disable your ability to log in through SSH using account passwords:
/etc/ssh/sshd_config
PasswordAuthentication no
sudo service sshd restart
On Ubuntu or Debian sudo service ssh restart
The first one is to install all available updates with yum.
yum update
yum install nano vim
CentOS 7.3 minimal don’t come pre-installed with the ifconfig command we will install it as follows:
yum install net-tools
Adjust the file /etc/hosts as follows:
nano /etc/hosts
Make the values like this:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
192.168.1.100 server1.example.com server1
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
4. Update or Upgrade CentOS Minimal Install
This will not install any new packages other than updating and installing the latest version of installed packages and security updates. Moreover Update and Upgrade are pretty same except the fact that Upgrade = Update + enable obsoletes processing during updates.
- yum update && yum upgrade
6. Install Apache HTTP Server
No matter for what purpose you will be using the server, in most of the cases you need a HTTP server to run websites, multimedia, client side script and many other things.
- yum install httpd
If you would like to change default port (80) of Apache HTTP Server to any other port. You need to edit the configuration file ‘/etc/httpd/conf/httpd.conf‘ and search for the line that starts typically like:
LISTEN 80
Change port number ‘80‘ to any other port (say 3221), save and exit.
Add the port you just opened for Apache through firewall and then reload firewall.
Allow service http through firewall (Permanent).
- firewall-cmd —add-service=http
Allow port 3221 through firewall (Permanent).
- firewall-cmd -permanent -add-port=3221/tcp
Reload firewall.
- firewall-cmd —reload
After making all above things, now it’s time to restart Apache HTTP server, so that the new port number is taken into effect.
- systemctl restart httpd.service
Now add the Apache service to system-wide to start automatically when system boots.
- systemctl start httpd.service
- systemctl enable httpd.service
Now verify the Apache HTTP Server by using links command line tool as shown in the below screen.
- links 127.0.0.1