How to change settings on Linux Systems

From CyberWurx Customer Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 20:03, 2 November 2007 (edit)
Cwadmin (Talk | contribs)
m (Protected "How to change settings on Linux Systems" [edit=sysop:move=sysop])
← Previous diff
Current revision (20:11, 2 November 2007) (edit) (undo)
Cwadmin (Talk | contribs)
(Fstab)
 
(One intermediate revision not shown.)
Line 69: Line 69:
= Fstab = = Fstab =
 +Fstab stores information about what it should mount during boot up.
 +
 +This file is important to keep accurate as it may affect your system to not boot up properly.
 +
 +Here is an example fstab file found:
 +/etc/fstab
 +
 +<pre>
 +# /etc/fstab: static file system information.
 +#
 +# <file system> <mount point> <type> <options> <dump> <pass>
 +/dev/hda1 / ext3 defaults,usrquota,errors=remount-ro 0 1
 +/dev/hda2 none swap sw 0 0
 +proc /proc proc defaults 0 0
 +</pre>
 +
 +If you want to add a drive to mount automatically at bootup simply add a line to fstab.
 +
 +For example:
 + /dev/sda1 /home ext3 defaults 0 1
 +
 +This will mount /dev/sda1 to /home with an ext3 filesystems with default options. It will also check for errors if needed.
 +
 +== Mounting tmp noexec ==
 +You can request a seperate partition for /tmp set up when installing your os.
 +
 +The advantage to this is using the noexec option. This will tighten security and not allow programs be ran out of /tmp

Current revision

This area will discuss the different operating systems we offer and where to change important system files.

Contents

Networking

The core system files of your network.

CentOS

CentOS will store network settings inside a directory named:

/etc/sysconfig/network-scripts/

The particular file that has your settings (depending on your interface), would be:

ifcfg-eth0 (or eth1 etc...)

The ifcfg-ethX file will look something like this:

DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.0.2
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
  • These settings are an example and by no means reflect your configuration.

Netconfig

These settings may be a little cryptic to the normal user, so CentOS came packaged with a network configuration interface.

Simply use the following command at your bash prompt:

netconfig

You will see a easy to understand, easy to use menu come up and allow you to enter your networking data.

After modifying your network information, you should either reboot or issue the following:

/etc/init.d/networking restart

Debian

Debian has a very uniform way of storing network settings and they are very easy to read and edit.

Network settings are stored in:

/etc/network/interfaces
  • Unlike CentOS, each interface's configuration will be stored in this file.

The file will look similar to this:

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
        address 192.168.0.2
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.1
iface eth1 inet static
        address 192.168.0.3
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.1
  • These settings are an example and by no means reflect your configuration.

To edit your network settings, simply change each value for each address.

Adding ips is simple as well. If you want a virtual interface simply add an area that looks similar to:

iface eth0:1 inet static
        address 66.154.82.74
        netmask 255.255.255.248
  • The eth0:1 part will increment every time you add a virtual interface. (eth0:2, eth0:3, etc...)

To restart your network services, simply issue the network restart script:

/etc/init.d/networking restart

Fstab

Fstab stores information about what it should mount during boot up.

This file is important to keep accurate as it may affect your system to not boot up properly.

Here is an example fstab file found: /etc/fstab

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>                              <dump>  <pass>
/dev/hda1       /               ext3    defaults,usrquota,errors=remount-ro     0       1
/dev/hda2       none            swap    sw                                      0       0
proc            /proc           proc    defaults                                0       0

If you want to add a drive to mount automatically at bootup simply add a line to fstab.

For example:

/dev/sda1      /home           ext3    defaults              0     1

This will mount /dev/sda1 to /home with an ext3 filesystems with default options. It will also check for errors if needed.

Mounting tmp noexec

You can request a seperate partition for /tmp set up when installing your os.

The advantage to this is using the noexec option. This will tighten security and not allow programs be ran out of /tmp

Personal tools