Archive for the tag 'Local'

Add nodev Option to Non-Root Local Partitions

Edit the file /etc/fstab. The important columns for purposes of this section are column 2 (mount point), column 3 (filesystem type), and column 4 (mount options). For any line which satisfies all of the conditions:

The filesystem type is ext2 or ext3
The mount point is not /

add the text “,nodev” to the list of mount options in column 4.

The nodev option prevents users from mounting unauthorized devices on any partition which is known not to contain any authorized devices. The root partition typically contains the /dev directory, which is the primary location for authorized devices, so this option should not be set on /. However, if system programs are being run in chroot jails, this advice may need to be modified further, since it is often necessary to create device files inside the chroot directory for use by the restricted program.

Delivering mail to local mail server if your DNS is hosted on remote Cpanel VSP

Login to WHM and go to “DNS Functions” and select “Edit a DNS Zone”

Select the zone to edit and then select the “Edit” button.

Once the next screen appears scroll down to the “Record Type” MX and change the value to mail.serverbuddies.com.

serverbuddies.com. 14400 IN MX 0 mail.serverbuddies.com.

Change the “Record Type” to “A” for mail and add the IP address of your local mailserver in the box to the right of the “CNAME” record type.

mail 14400 IN A 192.168.1.1

Now DNS server will instruct mail servers on the internet to deliver mail to your local mail server.

Edit the file /etc/localdomains and remove the domain name for which you want email delivered locally.

Edit the file /etc/remotedomains and add the domain name which we removed from /etc/localdomains

Now local (cpanel) mail server (Exim) will route all email originating from the local server to the remote mail server.

SBDavid

Setting local environment variables

Setting local environment variables

You can set your own environment variables directly from the bash shell.

Once you start a bash shell (or spawn a shell script), you’re allowed to create local variables that are visible within your shell process. You can assign either a numeric or a string value to an
environment variable by assigning the variable to a value using the equal sign:

root@dell:~# process=testing
root@dell:~# echo $process
testing

Now any time you need to reference the value of the test environment variable, just reference it by the name $process.

SBDavid

Local environment variables

Local environment variables

There isn’t a command that displays only local environment variables. The set command displays all of the environment variables set for a specific process. However, this also includes the global environment variables.

Here’s the output from a sample set command.

root@dell:~# set
BASH=/bin/bash
BASH_ARGC=()
BASH_ARGV=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSION=’3.2.39(1)-release’
COLORTERM=Terminal
COLUMNS=99
DESKTOP_SESSION=IceWM

We’ll notice that all of the global environment variables seen from the printenv command appear in the output from the set command. However, there are quite a few additional environment variables that now appear. These are the local environment variables.