SlideShare ist ein Scribd-Unternehmen logo
1 von 12
Downloaden Sie, um offline zu lesen
10 Essential
Steps to
Configuring a
New Server
User Configuration
● To change the root password: log in as root, run passwd, enter the new password, then again to confirm
● Setting up a password policy is fairly complex, full details are here, but essentially:
+ Install pam_cracklib
+ Edit the /etc/pam.d/common-password (Debian, Ubuntu, Mint) or /etc/pam.d/system-auth
(RHEL, Fedora, CentOS) file
+ Modify the various attributes in that file for
length, complexity, history
+ Edit the /etc/login.defs file and modify the
attributes there for expiration settings
● To create a new user: run useradd [username] as root,
then run passwd [username] to set the password for
that account.
● To give a user sudo access: run visudo as root, find
“root ALL=(ALL) ALL” in the sudoers file, add a new line
next to it and add “[username] ALL=(ALL) ALL” Save and close.
● To disable root: run sudo passwd -l root
1.
UpGuard.com | @UpGuard
● To set the hostname and gateway: edit the
/etc/sysconfig/network file
● To set the IP, netmask and broadcast: edit
the /etc/sysconfig/network-scripts/ifcfg-
eth0 file (Must restart the network service
for changes to take effect)
● To set DNS servers: edit /etc/resolv.conf
● To disable IPv6: edit /etc/sysctl.conf and
add “net.ipv6.conf.all.disable_ipv6 = 1”
Network Configuration2.
UpGuard.com | @UpGuard
● To list current packages: run yum list
installed or dpkg -l
● To install a package: run yum install
[package name] or apt-get install [package
name]
● To remove a package: run yum remove
[package name] or apt-get remove [package
name]
Package Management3.
UpGuard.com | @UpGuard
● To update everything: run yum update or
apt-get upgrade
● To set up automatic updates: install and
use yum-cron or unattended-upgrades
(apt)
Update Installation and Configuration4.
UpGuard.com | @UpGuard
● To sync with an NTP server:
edit the /etc/ntp.conf file
NTP and Time Drift5.
UpGuard.com | @UpGuard
● -To show your iptables: run iptables --
list
● -To delete an existing entry: run
iptables --delete [chain] [rule number]
● -To insert a new entry: run iptables --
insert [chain] [rule number]
● -Full details can be found here: http:
//linux.die.net/man/8/iptables
Firewalls and iptables6.
UpGuard.com | @UpGuard
● To disable ssh access for root: edit /etc/ssh/sshd_config, find “#PermitRootLogin
no” and remove the comment “#” symbol so the directive takes effect. Restart
ssh.
● To restrict ssh by IP: edit the sshd_config file and modify the AllowUsers directive
like so: AllowUsers user1@10.10.10.1 user2@10.10.10.2 etc.
● Moving from password authentication to
certificate based authentication is fairly
involved, requiring the generation of a key
pair and several configuration changes.
See a detailed guide for your distribution.
Securing SSH7.
UpGuard.com | @UpGuard
● To list all services and their status: run
systemctl list-unit-files --type=service or
chkconfig --list
● To prevent a service from
automatically starting: run systemctl
disable [service] or chkconfig [service]
off
● To set a service to start automatically:
run systemctl enable [service] or
chkconfig [service] on
Systemctl and Service Configuration8.
UpGuard.com | @UpGuard
● To see if SELinux is running (RHEL,
CentOS, Fedora): run getenforce or
sestatus
● To enable, disable or modify SELinux,
edit the /etc/selinux/config file
● Try AppArmor as an SELinux
alternative
SELinux and Further Hardening9.
UpGuard.com | @UpGuard
● Logs are usually stored in /var/log
● Check the documentation and
configuration files of your applications
to see what log levels they allow and
set the one that is appropriate for your
needs.
● Consider a centralized syslog server if
your environment warrants one
Logging10.
UpGuard.com | @UpGuard
Want more tips?
Visit UpGuard.com for more technical and how-to articles.
UpGuard.com | @UpGuard

Weitere ähnliche Inhalte

Mehr von CloudCheckr

Top 10 Java Vulnerabilities & How to Fix Them - Infographic
Top 10 Java Vulnerabilities & How to Fix Them - InfographicTop 10 Java Vulnerabilities & How to Fix Them - Infographic
Top 10 Java Vulnerabilities & How to Fix Them - InfographicCloudCheckr
 
Top 10 critical CVEs that can lead to a data breach - Infographic
Top 10 critical CVEs that can lead to a data breach - InfographicTop 10 critical CVEs that can lead to a data breach - Infographic
Top 10 critical CVEs that can lead to a data breach - InfographicCloudCheckr
 
Top 20 OWASP vulnerabilities & how to fix them - Infographic
Top 20 OWASP vulnerabilities & how to fix them - Infographic Top 20 OWASP vulnerabilities & how to fix them - Infographic
Top 20 OWASP vulnerabilities & how to fix them - Infographic CloudCheckr
 
5 Dysfunctions of a DevOps Team - Velocity Ignite 2014 - ScriptRock
5 Dysfunctions of a DevOps Team - Velocity Ignite 2014 - ScriptRock5 Dysfunctions of a DevOps Team - Velocity Ignite 2014 - ScriptRock
5 Dysfunctions of a DevOps Team - Velocity Ignite 2014 - ScriptRockCloudCheckr
 
Enterprise DevOps and the Cloud
Enterprise DevOps and the CloudEnterprise DevOps and the Cloud
Enterprise DevOps and the CloudCloudCheckr
 
4 Prerequisites for DevOps Success
4 Prerequisites for DevOps Success4 Prerequisites for DevOps Success
4 Prerequisites for DevOps SuccessCloudCheckr
 
DevOps vs The Enterprise
DevOps vs The EnterpriseDevOps vs The Enterprise
DevOps vs The EnterpriseCloudCheckr
 
DevOps Days New York
DevOps Days New YorkDevOps Days New York
DevOps Days New YorkCloudCheckr
 
What if Enterprise IT Built Race Cars?
What if Enterprise IT Built Race Cars?What if Enterprise IT Built Race Cars?
What if Enterprise IT Built Race Cars?CloudCheckr
 
Techno Arms Dealers and High Frequency Traders
Techno Arms Dealers and High Frequency TradersTechno Arms Dealers and High Frequency Traders
Techno Arms Dealers and High Frequency TradersCloudCheckr
 
10 IT Automation Conferences to Attend
10 IT Automation Conferences to Attend10 IT Automation Conferences to Attend
10 IT Automation Conferences to AttendCloudCheckr
 
Puppet vs. Chef - The Battle Wages On
Puppet vs. Chef - The Battle Wages OnPuppet vs. Chef - The Battle Wages On
Puppet vs. Chef - The Battle Wages OnCloudCheckr
 
Welcome Our Robot Overlords
Welcome Our Robot OverlordsWelcome Our Robot Overlords
Welcome Our Robot OverlordsCloudCheckr
 
Top 5 CIO's of 2012
Top 5 CIO's of 2012Top 5 CIO's of 2012
Top 5 CIO's of 2012CloudCheckr
 
ScriptRock Robotics Testing
ScriptRock Robotics TestingScriptRock Robotics Testing
ScriptRock Robotics TestingCloudCheckr
 
ScriptRock Overview
ScriptRock OverviewScriptRock Overview
ScriptRock OverviewCloudCheckr
 

Mehr von CloudCheckr (16)

Top 10 Java Vulnerabilities & How to Fix Them - Infographic
Top 10 Java Vulnerabilities & How to Fix Them - InfographicTop 10 Java Vulnerabilities & How to Fix Them - Infographic
Top 10 Java Vulnerabilities & How to Fix Them - Infographic
 
Top 10 critical CVEs that can lead to a data breach - Infographic
Top 10 critical CVEs that can lead to a data breach - InfographicTop 10 critical CVEs that can lead to a data breach - Infographic
Top 10 critical CVEs that can lead to a data breach - Infographic
 
Top 20 OWASP vulnerabilities & how to fix them - Infographic
Top 20 OWASP vulnerabilities & how to fix them - Infographic Top 20 OWASP vulnerabilities & how to fix them - Infographic
Top 20 OWASP vulnerabilities & how to fix them - Infographic
 
5 Dysfunctions of a DevOps Team - Velocity Ignite 2014 - ScriptRock
5 Dysfunctions of a DevOps Team - Velocity Ignite 2014 - ScriptRock5 Dysfunctions of a DevOps Team - Velocity Ignite 2014 - ScriptRock
5 Dysfunctions of a DevOps Team - Velocity Ignite 2014 - ScriptRock
 
Enterprise DevOps and the Cloud
Enterprise DevOps and the CloudEnterprise DevOps and the Cloud
Enterprise DevOps and the Cloud
 
4 Prerequisites for DevOps Success
4 Prerequisites for DevOps Success4 Prerequisites for DevOps Success
4 Prerequisites for DevOps Success
 
DevOps vs The Enterprise
DevOps vs The EnterpriseDevOps vs The Enterprise
DevOps vs The Enterprise
 
DevOps Days New York
DevOps Days New YorkDevOps Days New York
DevOps Days New York
 
What if Enterprise IT Built Race Cars?
What if Enterprise IT Built Race Cars?What if Enterprise IT Built Race Cars?
What if Enterprise IT Built Race Cars?
 
Techno Arms Dealers and High Frequency Traders
Techno Arms Dealers and High Frequency TradersTechno Arms Dealers and High Frequency Traders
Techno Arms Dealers and High Frequency Traders
 
10 IT Automation Conferences to Attend
10 IT Automation Conferences to Attend10 IT Automation Conferences to Attend
10 IT Automation Conferences to Attend
 
Puppet vs. Chef - The Battle Wages On
Puppet vs. Chef - The Battle Wages OnPuppet vs. Chef - The Battle Wages On
Puppet vs. Chef - The Battle Wages On
 
Welcome Our Robot Overlords
Welcome Our Robot OverlordsWelcome Our Robot Overlords
Welcome Our Robot Overlords
 
Top 5 CIO's of 2012
Top 5 CIO's of 2012Top 5 CIO's of 2012
Top 5 CIO's of 2012
 
ScriptRock Robotics Testing
ScriptRock Robotics TestingScriptRock Robotics Testing
ScriptRock Robotics Testing
 
ScriptRock Overview
ScriptRock OverviewScriptRock Overview
ScriptRock Overview
 

Kürzlich hochgeladen

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Kürzlich hochgeladen (20)

Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

10 Essential Steps For Configuring A New Server

  • 2. User Configuration ● To change the root password: log in as root, run passwd, enter the new password, then again to confirm ● Setting up a password policy is fairly complex, full details are here, but essentially: + Install pam_cracklib + Edit the /etc/pam.d/common-password (Debian, Ubuntu, Mint) or /etc/pam.d/system-auth (RHEL, Fedora, CentOS) file + Modify the various attributes in that file for length, complexity, history + Edit the /etc/login.defs file and modify the attributes there for expiration settings ● To create a new user: run useradd [username] as root, then run passwd [username] to set the password for that account. ● To give a user sudo access: run visudo as root, find “root ALL=(ALL) ALL” in the sudoers file, add a new line next to it and add “[username] ALL=(ALL) ALL” Save and close. ● To disable root: run sudo passwd -l root 1. UpGuard.com | @UpGuard
  • 3. ● To set the hostname and gateway: edit the /etc/sysconfig/network file ● To set the IP, netmask and broadcast: edit the /etc/sysconfig/network-scripts/ifcfg- eth0 file (Must restart the network service for changes to take effect) ● To set DNS servers: edit /etc/resolv.conf ● To disable IPv6: edit /etc/sysctl.conf and add “net.ipv6.conf.all.disable_ipv6 = 1” Network Configuration2. UpGuard.com | @UpGuard
  • 4. ● To list current packages: run yum list installed or dpkg -l ● To install a package: run yum install [package name] or apt-get install [package name] ● To remove a package: run yum remove [package name] or apt-get remove [package name] Package Management3. UpGuard.com | @UpGuard
  • 5. ● To update everything: run yum update or apt-get upgrade ● To set up automatic updates: install and use yum-cron or unattended-upgrades (apt) Update Installation and Configuration4. UpGuard.com | @UpGuard
  • 6. ● To sync with an NTP server: edit the /etc/ntp.conf file NTP and Time Drift5. UpGuard.com | @UpGuard
  • 7. ● -To show your iptables: run iptables -- list ● -To delete an existing entry: run iptables --delete [chain] [rule number] ● -To insert a new entry: run iptables -- insert [chain] [rule number] ● -Full details can be found here: http: //linux.die.net/man/8/iptables Firewalls and iptables6. UpGuard.com | @UpGuard
  • 8. ● To disable ssh access for root: edit /etc/ssh/sshd_config, find “#PermitRootLogin no” and remove the comment “#” symbol so the directive takes effect. Restart ssh. ● To restrict ssh by IP: edit the sshd_config file and modify the AllowUsers directive like so: AllowUsers user1@10.10.10.1 user2@10.10.10.2 etc. ● Moving from password authentication to certificate based authentication is fairly involved, requiring the generation of a key pair and several configuration changes. See a detailed guide for your distribution. Securing SSH7. UpGuard.com | @UpGuard
  • 9. ● To list all services and their status: run systemctl list-unit-files --type=service or chkconfig --list ● To prevent a service from automatically starting: run systemctl disable [service] or chkconfig [service] off ● To set a service to start automatically: run systemctl enable [service] or chkconfig [service] on Systemctl and Service Configuration8. UpGuard.com | @UpGuard
  • 10. ● To see if SELinux is running (RHEL, CentOS, Fedora): run getenforce or sestatus ● To enable, disable or modify SELinux, edit the /etc/selinux/config file ● Try AppArmor as an SELinux alternative SELinux and Further Hardening9. UpGuard.com | @UpGuard
  • 11. ● Logs are usually stored in /var/log ● Check the documentation and configuration files of your applications to see what log levels they allow and set the one that is appropriate for your needs. ● Consider a centralized syslog server if your environment warrants one Logging10. UpGuard.com | @UpGuard
  • 12. Want more tips? Visit UpGuard.com for more technical and how-to articles. UpGuard.com | @UpGuard