Lab 1 System Monitoring

Goal: To build skills to better assess system resources, performance and security.

Sequence 1: Inspecting your system

Scenario: You are assigned responsibility for this system. You must learn how it is
configured.

Deliverable: Knowledge about your system.

System Setup: Before you use the system, inspect its configuration by answering the following questions with the command(s) you used to derive this answer. Throughout the class, you may need to install additional software packages on your system. Consult the Appendix for information and instruction for installing software.

Instructions:

1. What IP addresses are configured for the system?

Use /sbin/ifconfig or /sbin/ip addr to find your IP addresses. One of them should be 192.168.0.X.

2. How are these IP addresses configured?

Look in /etc/sysconfig/network-scripts/ifcfg-*

3. What runlevel is the system currently in?

runlevel or who -r

4. How was this configured?

head -20 /etc/inittab Compare the "id" record value to /proc/cmdline in the event that the current runlevel was set by the bootloader(GRUB). cat /proc/cmdline

5. Which services are currently running?

service --status-all

6. Which services are installed?

chkconfig --list (This will only display services that are controlled by a service initialization script or by xinetd. Services started by other means will not be displayed.)

7. How many "end user" accounts are there?

Use the command getent passwd | sort -t":" -k 3 -g. The end user accounts are those 500 or above. The command above merely sorts all
user accounts.

8. Which account are you now using?

whoami

9. Has anyone else logged into your system recently?

last will show who recently logged in.

Sequence 2: Monitoring TCP/IP ports

Scenario: You have done your best to understand which services you must offer, and to whom, and now must verify this configuration. This is a mere exercise in a long and on-going effort to manage your system within the definitions of your Security Policy.

If you are located in an Internet-enabled classroom, please do not attempt to use nmap to scan machines outside the example.com domain or outside the 192.168.0.0/24 subnet unless instructed to do so. Thank you for your cooperation.

Deliverable: Familiarity with utilities in an audit of system services..

Instructions:

1. Work with a lab partner, and monitor network ports on each of your systems. Which TCP ports are open, and which have a service listening at the other end? With respect to your system, which ports have a service listening, but are not open to your partner?

a. For purposes of this lab, instructions will refer to station X and stationY, where stationX is the "local" system and stationY, the "remote." In the listings below, data redirected to a file is suggested, but not required while gathering data about the systems.

# netstat -tpnl > $HOME/netstat-stationY.out
# nmap stationX | grep tcp > $HOME/nmap-stationX.out

2. Determine which hosts are on your subnet.

a. Again, the nmap utility may be used to more broadly scan your system networking subnet. As we are using a IPV4 class C address range, the argument provided nmap is in the form "N.N.N.*", where "N" is replaced by the 3 octets of your IP network address.

# nmap -sP Your IP Network Address

3. Determine which programs, utilities or services are configured to run at system boot time. Which of these was configured during package installation, and which were configured by the system administrator?

a. Run chkconfig to audit your system, based on the current runlevel.

# chkconfig --list | grep $(runlevel | cut -d" " -f2):on

b. Each system initialization script contains lines used by chkconfig which describe how and when the script is to be run. Note that the example below uses regular expression classes to ensure, for example, a "space" and a "tab" are both matched.

To determine which scripts are default installed to run at system boot:

# grep '^#[[:space:]]chkconfig:[[:space:]][[:digit:]]\+' /etc/init.d/*

To determine which scripts are default installed not to run at system boot:

# grep '^#[[:space:]]chkconfig:[[:space:]]-' /etc/init.d/*

Sequence 3: Logging to a centralized loghost

Scenario: Your boss thinks it is a great idea to have one central logging host. Work together with your neighbor to configure your machine as a logging host.

Deliverable: A central logging host

Instructions:

1. Set up syslogd to accept remote messages.

a. Edit /etc/sysconfig/syslog, and add the -r option as below:

SYSLOGD_OPTIONS="-r -m 0"

2. Restart syslogd.

a. # service syslog restart

Now your machine will accept logging messages from other machines.

3. Set up syslogd to send some messages to another machine.

a. Append /etc/syslog.conf with the following line:

user.* @192.168.0.Y

Where 192.168.0.Y is your neighbor's IP address.

b. If you have SELinux problems, you may need to restore the context on all files in /etc/

# restorecon -R /etc/

4. Restart syslogd.

a. # service syslog restart

Now your machine sends messages from user programs to your neighbor's machine.

5. Test the new setup by using logger to generate a syslog message:

# logger -i -t yourname "This is a test"

Does the message appear in your neighbor's /var/log/messages?

6. Challenge questions:

Why does this message also appear in your own /var/log/messages?

How can you prevent it?

The message appears in /var/log/messages because the syslog.conf file has an entry that sends all user messages to /var/log/messages:

*.info;mail.none... /var/log/messages

To prevent this, add a user.none entry like the others:

*.info;user.none,mail.none... /var/log/messages

RH253读书笔记(1)-Lab 1 System Monitoring的更多相关文章

  1. RH253读书笔记(2)-Lab 2 System Resource Access Controls

    Lab 2 System Resource Access Controls Goal: To become familiar with system resource access controls. ...

  2. RH133读书 笔记(4) - Lab 4 System Services

    Lab 4 System Services Goal: Develop skills using system administration tools and setting up and admi ...

  3. RH133读书笔记(11)-Lab 11 System Rescue and Troubleshooting

    Lab 11 System Rescue and Troubleshooting Goal: To build skills in system rescue procedures. Estimate ...

  4. RH253读书笔记(4)-Lab 4 The Domain Name System

    Lab 4 The Domain Name System Goal: To install and configure a DNS server System Setup: Throughout th ...

  5. RH253读书笔记(3)-Lab 3 Securing Networking

    Lab 3 Securing Networking Goal: To build skills with the Netfilter packet filter Sequence 1: Applyin ...

  6. RH253读书笔记(6)-Lab 6 Implementing Web(HTTP) Services

    Lab 6 Implementing Web(HTTP) Services Goal: To implement a Web(HTTP) server with a virtual host and ...

  7. RH253读书笔记(5)-Lab 5 Network File Sharing Services

    Lab 5 Network File Sharing Services Goal: Share file or printer resources with FTP, NFS and Samba Se ...

  8. RH253读书笔记(7)-Lab 7 Electronic Mail

    Lab 7 Electronic Mail Goal: To build common skills with MTA configuration Estimated Duration: 90 min ...

  9. RH253读书笔记(9)-Lab 9 Account Management Methods

    Lab 9 Account Management Methods Goal: To build skills with PAM configuration Sequence 1: Track Fail ...

随机推荐

  1. atitit.java方法属性赋值and BeanUtils 1.6.1 .copyProperty的bug

    atitit.java分配给属性值方法and BeanUtils 1.6.1 .copyProperty的bug 1. core.setProperty(o, "materialId&quo ...

  2. Maven插件之git-commit-id-plugin

    SCM使用GIT而非SVN时,使用Maven发布,总是会出一些莫名其妙的问题,google查找原因,无意中看到了这个插件; 对于该插件,到目前为止,文档比较少,尤其是中文的文档;全部的信息都包含在项目 ...

  3. 询问任意区间的min,max,gcd,lcm,sum,xor,or,and

    给我们n个数,然后有m个询问,每个询问为L,R,询问区间[L,R]的最大最小值,最小公约数,最大公约数,和,异或,或,且 这些问题通通可以用RMQ的思想来解决. 以下用xor来作为例子 设dp[i][ ...

  4. C#操作注册表--DarrenF

    步骤/方法 读取指定名称的注册表的值 private string GetRegistData(string name) { string registData; RegistryKey hkml = ...

  5. 元素z-index继承问题

    两同层元素.当中一个的子元素定位与还有一个重叠时,该子元素被覆盖(此时子元素的z-index继承的是其父元素的z-index,不管其z-index多少均被覆盖) <html> <he ...

  6. hadoop-ha组态

    HADOOP HA组态 hadoop2.x的ha组态.这份文件是在那里的描述中hdfs与yarn的ha组态. 这份文件的假设是zk它已被安装并配置,事实上,任何安装. hdfs ha组态 首先.配置c ...

  7. go - 内置基础类型

    Go 语言中包括以下内置基础类型: 布尔型:bool 整型:int int64 int32 int16 int8 uint8(byte) uint16 uint32 uint64 uint 浮点型:f ...

  8. 精致的外观Request

    为什么要说Request精致的外观?请注意,我们这里所说的并不总是理解含义的外观门面,事实上,它使用的立面设计图案.使用的主要考虑数据安全的门面.它涉及到一个更大的系统系统的多个子系统之间的互动沟通. ...

  9. 为什么Redis比Memcached易

    GitHub版本号地址: https://github.com/cncounter/translation/blob/master/tiemao_2014/Redis_beats_Memcached/ ...

  10. 自定义ViewGroup实现垂直滚动

    转载请表明出处:http://write.blog.csdn.net/postedit/23692439 一般进入APP都有欢迎界面,基本都是水平滚动的,今天和大家分享一个垂直滚动的例子. 先来看看效 ...