cp -Rfv /etc ./etc
vim Security.sh
#!/bin/bash
if [ -f "/etc/passwd" ] ; then
echo "passwd file exists"
grep -n -v -f "./etc/passwd" "/etc/passwd"
else
echo "passwd file does not exist"
fi
if [ -f "/etc/group" ] ; then
echo "group file exists"
grep -n -v -f "./etc/group" "/etc/group"
else
echo "group file does not exist"
fi
exit 0
i to edit esc hold shift ZZ to save and exit
to exit without saving hit the esc key then :q! enter
chmod +x Security.sh
./Security
You must have 4 files checked in order to get credit for this assignment. I only do 2 in this example.
Wednesday, May 25, 2011
Saturday, May 21, 2011
Remote Logging And Test
Remote Logging Receiving Server:
Setting Up The Receiving Host:
Red Hat:
vi /etc/sysconfig/rsyslog
CentOS:
vi /etc/sysconfig/syslog
Edit File Change Line To:
SYSLOGD_OPTIONS="-c 2 -r"
i to edit. Esc then shift ZZ to save and exit.
Now Edit:
Red Hat:
vi /etc/rsyslog.conf
CentOS:
vi /etc/syslog.conf
i to edit. Change the lines below Provides UDP syslog reception and Provides TCP syslog reception by un-commenting the lines. Esc then shift ZZ to save and exit.
Update The Remote System Log:
Red Hat:
service rsyslog restart
CentOS:
/sbin/service syslog restart
last
command finds the when people logged in and out of the system along with what time and where from.
last | tail
will give you just the recent logins and logouts.
logger Your Message Goes Here
Lets you test the logging of the log files. Your message will be in the messages log file. You can find the log messages with regards to a certain user by using grep.
grep yourusername /var/log/messages
Setting Up The Receiving Host:
Red Hat:
vi /etc/sysconfig/rsyslog
CentOS:
vi /etc/sysconfig/syslog
Edit File Change Line To:
SYSLOGD_OPTIONS="-c 2 -r"
i to edit. Esc then shift ZZ to save and exit.
Now Edit:
Red Hat:
vi /etc/rsyslog.conf
CentOS:
vi /etc/syslog.conf
i to edit. Change the lines below Provides UDP syslog reception and Provides TCP syslog reception by un-commenting the lines. Esc then shift ZZ to save and exit.
Update The Remote System Log:
Red Hat:
service rsyslog restart
CentOS:
/sbin/service syslog restart
last
command finds the when people logged in and out of the system along with what time and where from.
last | tail
will give you just the recent logins and logouts.
logger Your Message Goes Here
Lets you test the logging of the log files. Your message will be in the messages log file. You can find the log messages with regards to a certain user by using grep.
grep yourusername /var/log/messages
Subscribe to:
Comments (Atom)