Category Redhat Centos

sed delete all lines after

Objective: Prep dev httpd.conf for production Tasks: Remove jenkins virtual host entry (which starts with a comment line “#Start Jenkins”) Replace .dev with nothing (ex: www.dev.example.com becomes www.example.com) Replace debug with error (ex: Loglevel debug becomes Loglevel error) Sed to…

rollback httpd.conf changes on error

To rollback httpd.conf changes on error use this script: #!/bin/bash #File: deploy_new_httpd_conf.sh #Define this PATH_TO_NEW_HTTPD_CONF=”~” #Backup old httpd.conf file /bin/cp -f #Copy new httpd.conf over the existing one /bin/cp -f ${PATH_TO_NEW_HTTPD_CONF} #Test the Syntax /usr/sbin/apachectl -t if…

redhat add multiple users

useradd script to add multiple users to a system and force them to change their password upon login try the following script: Redhat # for name in someuser anotheruser yetanotheruser; do useradd $name; echo ‘password’ | passwd –stdin $name; chage…

linux disable ssh timeout

On Linux disable SSH timeouts You’ll need to edit /etc/ssh/sshd_config and set these directives: TCPKeepAlive yes ClientAliveInterval 30 ClientAliveCountMax 99999 To set SSH to disconnect if the user does not input anything for then hours: TCPKeepAlive yes ClientAliveInterval 60 ClientAliveCountMax…

RHCSA Quick-Notes

Configure client to use ntp-server 192.168.0.4 # nano -w Add line: server 192.168.0.4 iburst Remove lines: server 0 …. server 1 …. server 2 …. # service ntpd restart # chkconfig ntpd on Resize logical volume (lv) mounted at…

RHCSA Training Labs

These are some labs I have crafted to prep for the RHCSA exam.  Hopefully you will find this useful! Brakertech’s RHCSA Training Labs Objective: Configure NTP Client to sync against a custom NTP server Configure Local NTP Server The first…