Posts Tagged ‘HowTo’

Use iWork to Cool 15inch MacBook Pro

Posted in HowTo, MAC on May 22nd, 2010 by Doug – Be the first to comment


If you are running a MacBook Pro, you know they run hot. I solved this issue on the cheap by recycling an iWork Retail Eddition box to allow for more airflow under the the MacBook. All you need is to allow a bit of air to flow on the bottom surface and this box happens to be just the right hight to accomplish with ease.

Network Connect with OS X 10.6 Snow Leopard

Posted in Uncategorized on December 31st, 2009 by Doug – 1 Comment

I recently performed a clean install of OS X Snow Leopard on my PowerMac Pro and ran into issues when trying to connect to my companies SSL VPN. While there are numerous posts found on the web, none seem to pertain to a clean install of Snow Leopard. After debugging the issue furtherI found that Network Connect was still having permission issues when trying to connect via the Network Connect client.

Here is what I did to resolve the problem:

Install NetworkConnect.dmg with the version that your Juniper SSL VPN device supports. In my case, it was 6.1

Open up Terminal and type the following commands followed by enter after each line. As you will be using sudo, you may be prompted for your password as well:

sudo chmod 755 /usr/local/juniper/nc/6.1.0/
sudo mkdir '/Applications/Network Connect.app/Contents/Frameworks'

I original found the above steps at various sites including the Juniper support forums but I was still running into permission issues. After digging further into the log files I found this and determined that there must be some sort of elevated root permission that needs to update some network settings that can only be done as a super user.

ncproxyd[19016] ncproxyd.info ncproxyd exiting status 1 (ncproxyd.cpp:92)
ncproxyd[19054] ncproxyd.error Failed to gain root privileges: Operation not permitted

To fix this you must modify the permissions of ncproxyd

chmod 4711 /usr/local/juniper/nc/6.3.0/ncproxyd

RSYNC over SSH

Posted in HowTo on January 28th, 2009 by Doug – Be the first to comment

If you ever need to copy files across a network and wanted a quick and easy way to do it without FTP, NFS, SAMBA or an other remote directory access solutions. RSYNC is usually part of most Unix or Linux distributions and can be easily installed.

The most basic of options is below:

rsync -avz -e ssh user@remotehost:/path/to/dir /local/dir/

Shutdown or Restart Windows from a Remote Desktop Session

Posted in HowTo on January 16th, 2009 by Doug – Be the first to comment

Ever needed to shutdown or restart windows from a remote desktop session? I was wondering this very thing today as my monitor locked up on my Dell E6500 laptop. Since the shutdown or restart feature are not enabled on the start menu in an RDP session, you need to do the following:

CTRL-ALT-END

You will then have the option to restart or shutdown the remote computer.

Install Bind 9 DNS Server (CHROOT) – Debian Etch and Ubuntu

Posted in HowTo on January 16th, 2009 by Doug – 4 Comments

BIND (Berkley Internet Name Domain) is the most common of all DNS servers and generally a standard on most Linux and UNIX distributions.

For a more detailed look at Bind and its technical history take a look at the Wikipedia article on Bind.

CHROOT is commonly referred to as JAIL and is often used to change the root of an application to another location for the reasons of security. Often times CHROOT is used for services that run under root user and can be insecure so it is a way of protecting the root operating system in the event of an application compromise.

In this HowTo, we will be installing BIND9 and CHROOTing bind to live in an restricted portion of the Linux file system. For the purposes of this HowTo we will be using a running installation of Debian Etch.

Assumptions

1. Bind will be configured as an authoritative DNS master resolving for specific domain names

2. You have limited knowledge of Linux editors such as vi

3. Utilization of Sudo. If you do not use sudo, simply eliminate sudo from any commands however you will need to be logged in as a root user

Install Bind 9

sudo apt-get install bind9

CHROOT Bind 9

sudo /etc/init.d/bind9 stop

Edit /etc/default/bind9 and configure bind to run as an unprivileged user and chrooted to /var/lib/named as follows:

OPTIONS=”-u bind -t /var/lib/named”

# Set RESOLVCONF=no to not run resolvconf

RESOLVCONF=yes

Create the necessary directories /var/lib

sudo mkdir -p /var/lib/named/etc

sudo mkdir /var/lib/named/dev

sudo mkdir -p /var/lib/named/var/cache/bind

sudo mkdir -p /var/lib/named/var/run/bind/run

Move the default bind config directory from /etc to /var/lib/named/etc

sudo mv /etc/bind /var/lib/named/etc

Create a symbolic link to the new config directory form the old location to the new locations

sudo ln -s /var/lib/named/etc/bind /etc/bind

Make null and random devices and set the correct file permissions

sudo mknod /var/lib/named/dev/null c 1 3

sudo mknod /var/lib/named/dev/random c 1 8

sudo chmod 666 /var/lib/named/dev/null /var/lib/named/dev/random

sudo chown -R bind:bind /var/lib/named/var/*

sudo chown -R bind:bind /var/lib/named/etc/bind

Modify syslogd to log to the right location

sudo vi /etc/default/syslogd

Modify the line SYSLOGD=”” so it reads SYSLOGD=”-a /var/lib/named/dev/log”

#

# Top configuration file for syslogd

#

#

# Full documentation of possible arguments are found in the manpage

# syslogd(8).

#

#

# For remote UDP logging use SYSLOGD=”-r”

#

SYSLOGD=”-a /var/lib/named/dev/log”

Restart syslogd and start bind

sudo /etc/init.d/sysklogd restart

sudo /etc/init.d/bind9 start

Check for logs by tailing /var/log/syslog for any error messages

sudo cat /var/log/syslog

or

sudo tail –f /var/log/syslog

Testing

Now that Bind 9 is installed, you will want to test and this can be done with the following command:

dig @localhost www.yahoo.com

Configure Bind 9

The next step is to create a master zone directory followed by a zone template. It is extremely important to be cognizant of file permissions. If you get these wrongs, Bind will not resolve for your domains. Each zone file needs to be owned by the user and group bind. So if you create a new zone make sure to assign the right permissions to the new zone file

sudo mkdir -p /etc/bind/zones

sudo chown bind:bind /etc/bind/zones

sudo chmod 700 /etc/bind/zones

Create a template zone file

sudo vi /etc/bind/zones/template

;

; SOA

;

$TTL    1h

@               IN      SOA     dns1.example.com. hostmaster.example.com. (

                        2007010101      ; Serial number

                        1h              ; Slave refresh

                        15m             ; Slave retry

                        2w              ; Slave expire

                        1h              ; Negative Cache TTL

                        )

;

; NS RECORDS

;

@               IN      NS              dns1.example.com.

@               IN      NS              dns2.example.com.

;

; MAIL RECORDS

;

                IN      MX      10      mx01.example.com.

                IN      MX      10      mx02.example.com.

;

; MAIL HOSTS

;

mx01            IN      A               1.2.3.4

mx02            IN      A               1.2.3.4

mail01          IN      A               1.2.3.4

mail02          IN      A               1.2.3.4

;

; WWW RECORDS

;

@               IN      A               1.2.3.4

www             IN      A               1.2.3.4

blog            IN      A               1.2.3.4

;

; CUSTOM RECORDS

;

server-a        IN      A               1.2.3.4

server-b        IN      A               1.2.3.4

Again, ensure you have the right permissions for the zone file.

sudo chown bind:bind /etc/bind/zones/template

sudo chmod 600 /etc/bind/zones/template

Create a New Zone

Copy the zone file template from above and edit as needed.

sudo cp -p /etc/bind/zones/template db.example.com

At the very minimum the serial number and edit the file as needed.

Next, enable the zone file in /etc/bind/named.local

sudo /etc/bind/named.conf.local

zone “example.com” {

        type master;

        file “/etc/bind/zones/db.example.com”;

        notify yes;

     };

Reload Bind and test

sudo tail -f /var/log/syslog

sudo tail -f /var/log/daemon.log

dig @localhost example.com MX

Feel free to contact me with any questions or revisions.

Special thanks to the following sites for contrbuting information:

http://doc.ubuntu.com/ubuntu/serverguide/C/dns-configuration.html

http://www.howtoforge.org/perfect_setup_debian_etch_p4

http://www.besy.co.uk/debian/how_to_setup_a_bind_9_dns_server