Skip to content
Go back

RHEL Intensive - Services: AWS, Networking, FTP, Apache, Firewalls, SELinux, and Samba

Edit page

๐ŸŽฏ New to RHEL or AWS? This guide covers essential services for system administration, including AWS integration, networking, FTP, Apache, Firewalld, SELinux, and Samba. Each section includes theory, commands, and beginner tips to help you confidently manage RHEL systems and cloud services.


Linux Server

Table of Contents

Open Table of Contents

๐ŸŒ Introduction to AWS Services

Amazon Web Services (AWS) is a leading cloud platform offering over 250 services for computing, storage, networking, databases, AI, analytics, and more. Itโ€™s widely used for scalable, cost-effective infrastructure.

Creating a Free AWS Account

AWS offers a Free Tier for new users to explore services with limited usage for 12 months. Hereโ€™s how to create one:

  1. Visit aws.amazon.com/free.
  2. Click Create a Free Account.
  3. Provide an email, password, and account name.
  4. Enter contact and billing details (a valid credit/debit card is required for verification, but you wonโ€™t be charged unless you exceed Free Tier limits).
  5. Verify your identity via phone or SMS.
  6. Select the Basic Support Plan (free) and complete the setup.

Free Tier Highlights:

Tip: Monitor usage via the AWS Billing Dashboard to stay within Free Tier limits. For detailed setup, see AWS Free Tier Guide.

Global Infrastructure

AWS operates globally, ensuring low-latency and high-availability services:

Theory: Choose a region close to your users for lower latency. AZs provide fault tolerance by isolating failures.

Core AWS Services

CategoryServicePurposeExample Use Case
ComputeEC2Virtual machinesHosting RHEL servers
LambdaServerless code executionEvent-driven scripts
Auto ScalingScale EC2 based on demandHandle traffic spikes
NetworkingVPCIsolated private networkSecure RHEL deployments
ELBLoad balancer for EC2Distribute web traffic
Route 53Scalable DNS serviceDomain management
StorageS3Object storageStore backups, media
EBSBlock storage for EC2Persistent storage for RHEL VMs
DatabaseRDSManaged SQL databasesMySQL/PostgreSQL for apps
DynamoDBNoSQL key-value storeHigh-speed data for mobile apps
ElastiCacheIn-memory cache (Redis/Memcached)Speed up web apps
Content DeliveryCloudFrontContent Delivery Network (CDN)Cache static content globally
SecurityIAMUser and role access controlRestrict AWS resource access
KMSKey management for encryptionEncrypt sensitive data
WAFWeb Application FirewallProtect against SQL injection
ACMSSL/TLS certificate managementSecure HTTPS for websites
InspectorVulnerability scanner for EC2Audit RHEL instances
MonitoringCloudWatchLogs, metrics, alarmsMonitor RHEL server health
AnalyticsKinesisReal-time data streamingTrack user clicks
EMRManaged Hadoop for big dataProcess large datasets
GlueETL (Extract, Transform, Load)Data integration
RedshiftData warehouseBusiness analytics
AthenaQuery S3 data with SQLAnalyze logs
QuickSightBusiness intelligence dashboardsVisualize metrics
App ServicesRekognitionImage/video analysisDetect objects in media
SNSNotifications (SMS, email, push)Send alerts
SESEmail sending serviceBulk email campaigns
SQSMessage queueQueue tasks for apps
API GatewayCreate and manage REST APIsBuild APIs for RHEL apps
CognitoUser authentication and identityUser login for web apps
DevOpsCloudFormationInfrastructure as Code (IaC)Automate RHEL deployments
CodeCommitGit repositoryStore code
CodeBuildBuild and test codeCompile RHEL apps
CodeDeployDeploy code to EC2/LambdaUpdate RHEL servers
CodePipelineCI/CD automationAutomate app deployment
CodeStarAll-in-one DevOps dashboardManage projects with JIRA integration

Beginner Tip: Start with EC2 for RHEL servers, S3 for storage, and IAM for security. Use AWS Management Console for a user-friendly interface.

Specialty Services

Example: Use IoT Core to manage smart devices with RHEL as a gateway. Learn more at AWS IoT Core.

Compute Services

Example: Deploy a RHEL-based web server on EC2. See EC2 Getting Started.

Containers

Tip: Use ECS with RHEL-based Docker images for scalable apps. Learn at AWS ECS.

Storage

Example: Back up RHEL logs to S3. See S3 Getting Started.

Databases

Tip: Use RDS for RHEL-hosted databases. See RDS Documentation.

Analytics & Big Data

Example: Analyze RHEL server logs with Athena. Learn at AWS Athena.

Machine Learning & AI

Example: Use Rekognition to analyze images stored in S3. See AWS Rekognition.

Security & Identity

Tip: Secure RHEL EC2 instances with IAM roles. See IAM Best Practices.

Communication

Example: Notify admins via SNS for RHEL server alerts. Learn at AWS SNS.

Developer Tools

Example: Use CloudFormation to deploy RHEL EC2 instances. See CloudFormation Guide.

Cost Management

Tip: Use Budgets to monitor Free Tier usage. See AWS Cost Management.

EC2 Instance Families

EC2 instances are grouped by use case:

FamilyPurposeExamples
General PurposeBalanced CPU/memoryt4g.micro, m5.large
Compute OptimizedHigh-performance CPUsc7g.large, c5n.xlarge
Memory OptimizedRAM-intensive appsr6i.large, x2idn.24xlarge
Storage OptimizedHigh-speed storagei4i.large, d3.xlarge
Accelerated ComputingGPU/ML tasksp4d.24xlarge, g5.xlarge

Tip: Use t4g.micro (ARM-based Graviton) for Free Tier RHEL instances. See EC2 Instance Types.

EBS Volume Types

EBS provides block storage for EC2:

TypeDescriptionUse Case
gp3General-purpose SSDDefault for RHEL VMs
gp2Older general-purpose SSDLegacy workloads
io2/io2 Block ExpressHigh-performance SSDDatabases (MySQL, Oracle)
st1Throughput-optimized HDDBig data, logs
sc1Cold HDD (cheapest)Archival

Tip: Use gp3 for cost-effective performance. See EBS Volume Types.

S3 Storage Classes

S3 storage classes optimize cost and access speed:

ClassRetrieval TimeUse Case
StandardInstantFrequent access
Intelligent-TieringInstantUnpredictable access
Standard-IAInstantInfrequent access
One Zone-IAInstantNon-critical backups
Glacier Instant RetrievalMillisecondsRare access
Glacier Flexible RetrievalMinutes/HoursCold storage
Glacier Deep Archive12+ hoursLong-term archival

Tip: Use Intelligent-Tiering for RHEL logs with varying access patterns. See S3 Storage Classes.


๐Ÿ“ก Server-Client Model (NFS Setup)

Network File System (NFS) allows file sharing between RHEL servers and clients.

On Server

  1. Set Hostname:

    sudo hostnamectl set-hostname server1.example.com
    cat /etc/hostname
  2. Add DNS Entry: Edit /etc/hosts:

    sudo nano /etc/hosts

    Add:

    192.168.1.10  server1.example.com
  3. Install NFS:

    sudo yum install nfs-utils -y
  4. Start Services:

    sudo systemctl start rpcbind nfs-server
    sudo systemctl enable rpcbind nfs-server
  5. Verify Ports (NFS uses 2049):

    sudo ss -tulpn | grep 2049
  6. Create Share:

    sudo mkdir -p /server
    sudo chmod -R 755 /server
  7. Configure Exports: Edit /etc/exports:

    sudo nano /etc/exports

    Add:

    /server 192.168.1.0/24(rw,sync,no_root_squash)
  8. Export Share:

    sudo exportfs -rv
  9. Firewall Rules:

    sudo firewall-cmd --permanent --add-service=nfs
    sudo firewall-cmd --reload

On Client

  1. Check Exports:

    showmount -e server1.example.com
  2. Mount Share:

    sudo mkdir -p /data
    sudo mount server1.example.com:/server /data
  3. Persistent Mount: Edit /etc/fstab:

    server1.example.com:/server /data nfs defaults 0 0

Theory: NFS enables seamless file sharing in a server-client model, ideal for centralized storage.

Tip: Use firewalld instead of disabling the firewall. See NFS Documentation.


๐Ÿ“‚ FTP (File Transfer Protocol)

FTP transfers files between systems. vsftpd is the default FTP server in RHEL.

Installation

sudo yum install vsftpd -y

Start Service

sudo systemctl start vsftpd
sudo systemctl enable vsftpd

Firewall Rules

sudo firewall-cmd --permanent --add-service=ftp
sudo firewall-cmd --reload

Configure vsftpd

Edit /etc/vsftpd/vsftpd.conf:

anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
allow_writeable_chroot=YES
pasv_enable=YES
pasv_min_port=30000
pasv_max_port=31000

Restart:

sudo systemctl restart vsftpd

Add FTP User

sudo adduser ftpuser
sudo passwd ftpuser
sudo mkdir -p /home/ftpuser/ftp_files
sudo chown ftpuser:ftpuser /home/ftpuser/ftp_files

Test Connection

ftp 192.168.1.10

SELinux Context

Set context for FTP directories:

sudo chcon -t public_content_t /home/ftpuser/ftp_files
sudo semanage fcontext -a -t public_content_t "/home/ftpuser/ftp_files(/.*)?"
sudo restorecon -Rv /home/ftpuser/ftp_files

Theory: FTP uses ports 21 (control) and 20 (data in active mode). SFTP (port 22) is more secure. See vsftpd Documentation.

Tip: Enable passive mode for firewall compatibility.


๐ŸŒ Apache HTTP Server

Apache serves web content and is widely used in RHEL.

Installation

sudo yum install httpd -y

Start Service

sudo systemctl start httpd
sudo systemctl enable httpd

Firewall Rules

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload

Configure Virtual Host

Edit /etc/httpd/conf.d/site1.conf:

<VirtualHost *:80>
    ServerName site1.example.com
    DocumentRoot /var/www/site1
    <Directory /var/www/site1>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog /var/log/httpd/site1_error.log
    CustomLog /var/log/httpd/site1_access.log combined
</VirtualHost>

Create directory:

sudo mkdir -p /var/www/site1
sudo echo "<h1>Hello from site1</h1>" > /var/www/site1/index.html
sudo chown -R apache:apache /var/www/site1

SELinux Context

sudo chcon -R -t httpd_sys_content_t /var/www/site1
sudo semanage fcontext -a -t httpd_sys_content_t "/var/www/site1(/.*)?"
sudo restorecon -Rv /var/www/site1

Test Config

sudo httpd -t
sudo systemctl restart httpd

Theory: Apache uses a modular architecture with virtual hosts for multiple websites. See Apache Documentation.

Tip: Use apachectl configtest to avoid downtime from config errors.


๐Ÿ”ฅ Firewalld

Firewalld is RHELโ€™s default firewall, using zones and services for dynamic management.

Key Commands

Theory: Firewalld simplifies firewall management with predefined services (e.g., http, ftp). Zones allow context-based rules.

Tip: Always use --permanent to persist rules. See Firewalld Documentation.


๐Ÿ”’ SELinux

SELinux enforces mandatory access control in RHEL.

Check Status

getenforce
sestatus

Set Mode

Temporary:

setenforce 0  # Permissive
setenforce 1  # Enforcing

Permanent: Edit /etc/selinux/config:

SELINUX=enforcing

Manage Contexts

View file context:

ls -Z /var/www/html

Set context:

sudo chcon -t httpd_sys_content_t /var/www/html/index.html
sudo semanage fcontext -a -t httpd_sys_content_t "/var/www/html(/.*)?"
sudo restorecon -Rv /var/www/html

Booleans

List:

getsebool -a | grep httpd

Set:

setsebool -P httpd_enable_homedirs on

Logs

Check denials:

grep denied /var/log/audit/audit.log

Analyze:

sudo yum install policycoreutils-devel -y
audit2why < /var/log/audit/audit.log

Theory: SELinux uses contexts to enforce security policies, even for root. See Red Hat SELinux Guide.

Tip: Use permissive mode for troubleshooting, then re-enable enforcing.


๐Ÿ“‚ Samba

Samba enables file sharing between RHEL and Windows systems.

Installation

sudo yum install samba samba-client samba-common -y

Configure Share

Edit /etc/samba/smb.conf:

[global]
   workgroup = WORKGROUP
   server string = Samba Server %v
   netbios name = rhel-server
   security = user
   map to guest = bad user

[shared]
   path = /srv/samba/shared
   browsable = yes
   writable = yes
   guest ok = yes
   read only = no

Create directory:

sudo mkdir -p /srv/samba/shared
sudo chown -R nobody:nogroup /srv/samba/shared
sudo chmod -R 0775 /srv/samba/shared

SELinux Context

sudo chcon -t samba_share_t /srv/samba/shared
sudo semanage fcontext -a -t samba_share_t "/srv/samba/shared(/.*)?"
sudo restorecon -Rv /srv/samba/shared

Firewall Rules

sudo firewall-cmd --permanent --add-service=samba
sudo firewall-cmd --reload

Start Services

sudo systemctl start smbd nmbd
sudo systemctl enable smbd nmbd

Add Samba User

sudo adduser smbuser
sudo smbpasswd -a smbuser
sudo smbpasswd -e smbuser

Test Share

From Windows: \\<server-ip>\shared

From Linux:

smbclient //192.168.1.10/shared -U smbuser

Theory: Samba uses SMB/CIFS for cross-platform file sharing. See Samba Documentation.

Tip: Restrict access with valid users for security.


๐Ÿงญ Whatโ€™s Next?

Youโ€™re now ready to manage AWS services, NFS, FTP, Apache, Firewalld, SELinux, and Samba on RHEL! Practice in a Free Tier AWS account or a local VM. Explore advanced topics like Ansible for automation or AWS CloudFormation for infrastructure. Questions? Check Red Hat Documentation or AWS Training.


Edit page
Share this post on:

Next Post
RHEL Intensive โ€“ Network, User, and System Administration: A Beginnerโ€™s Guide