Search This Blog

Monday, January 24, 2011

Single user mode.

Before bringing your machine is single user mode
Make sure
1)you inform other users logged in about the event using wall command.
2)If you are sharing a files using NFS protocol Make sure you disable network access to shared file systems using exportfs -ua.
3)Make sure no critical process such as backupjobs are running in background.
#/sbin/telinit 1
5)confirm the runlevel using runlevel command.

Here is a different way of doing it at system boot.

Here are some issues faced by me during single user mode.

Wall command in linux

This command has lot of usage to System Administration.
wall command becomes very handy in situation where superuser is forced to restart the machine or need inform other user about next scheduled downtime .

#wall "We are going to restart this server .Kindly log off or save all your work within next 15 minutes"

above message will get displayed on every terminal user of the server .

IP tables Simplified.

IPtables in unix are nothing but firewall rules defined for the machines.

There are four types of IPtables.

  1. Filter Table(default table)
  2. NAT table
  3. Mangle table
  4. Raw table

To list the iptables you need to type following command.

1) Filter table:
# iptables --list (if you dont specify -t (type) filter tables will be displayed)
# iptables -t filter --list

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

2) To list mangle tables.

# iptables -t mangle --list

3) To list NAT tables.

#iptables -t nat --list

4) To list raw tables.

# iptables -t raw --list

start or stop iptables rules

To start (Enforce) iptable rules:

#Service iptables start

To stop (rollback) iptables rules:

#Service iptables stop

More Information over iptables can be obtained from below link.