Archive for the 'Linux' Category

Page 2 of 3

So I’ve Decided to Take The RHCE Exam

According to the Internets, the RHCE is the “crown jewel of Linux certifications,” and since I don’t have any Linux certifications at the moment, I’ve decided to give it a shot. After taking the Pre-assessment Questionnaires about a month ago and seeing that I was in pretty good shape already, I decided to self-study using Michael Jang’s book and the Red Hat Deployment Guide rather than taking thousands of dollars worth of Red Hat classes. The more perceptive among you may have noticed my new wiki containing my RHCE “Cheat Sheet”. Hopefully someone else out there will find it useful.

Even though I can do about 95% of the stuff on the RHCE Prep Guide off the top of my head, the horror stories I’ve been reading about this test are making me pretty nervous. Any tips from current RHCEs would be appreciated. Also, if anyone is interested in logging into my test machine at home and doing something to make it unbootable, that would help me practice for the troubleshooting part of the exam.

I’m scheduled to take the test in Philadelphia on September 4th, which coincidentally, is my birthday. I guess I won’t know if that’s a good thing or a bad thing until I get the test results.

Active Directory Authentication with Winbind on Red Hat Linux

This example assumes that you have properly configured DNS servers, so that the Kerberos realm can be discovered via DNS. This should get taken care of for you automatically on Active Directory domains:

_kerberos             IN  TXT  EXAMPLE.COM
_kerberos._udp        IN  SRV  0 0 88 server.example.com.
_kerberos._tcp        IN  SRV  0 0 88 server.example.com.
_kpasswd._udp         IN  SRV  0 0 464 server.example.com.
_kpasswd._tcp         IN  SRV  0 0 464 server.example.com.
_ldap._tcp.dc._msdcs  IN  SRV  0 0 389 server.example.com.

On your Linux box, set the fully-qualified hostname in /etc/sysconfig/network and /etc/hosts. Note that the first part of your hostname must be no longer than 15 characters and unique in the domain:

# /etc/sysconfig/network
HOSTNAME=myhostname.example.com
# /etc/hosts
127.0.0.1  myhostname.example.com  myhostname  localhost.localdomain localhost

Make sure your Linux box has a properly configured DNS client (probably pointing at your domain controllers):

search example.com
nameserver 192.168.1.10

Since Kerberos is very sensitive to clock drift, it’s a good idea to configure your Linux box as an NTP client to your domain controllers. Edit /etc/ntp.conf like so:

server server.example.com

Install Winbind and configure the service to start automatically:

yum install samba-common
chkconfig winbind on

Use Red hat’s authconfig command to configure Winbind authentication:

authconfig \
  --disablecache \
  --enablewinbind \
  --enablewinbindauth \
  --smbsecurity=ads \
  --smbworkgroup=EXAMPLE \
  --smbrealm=EXAMPLE.COM \
  --enablewinbindusedefaultdomain \
  --winbindtemplatehomedir=/home/%U \
  --winbindtemplateshell=/bin/bash \
  --enablekrb5 \
  --krb5realm=EXAMPLE.COM \
  --enablekrb5kdcdns \
  --enablekrb5realmdns \
  --enablelocauthorize \
  --enablemkhomedir \
  --enablepamaccess \
  --updateall

Now you should be able to join your Linux box to the domain:

net ads join -U Administrator

Start (or restart) the Winbind service:

service restart winbind

At this point, your Linux box should be participating on the Windows domain. You can test this by issuing wbinfo -u (to list all users in the domain), wbinfo -g (to list all groups in the domain), and getent passwd administrator (to list account information for the domain administrator).

Resizing an LVM + EXT3 Partition

I do this often enough, so I might as well make my life easier and document it!

To grow/extend a partition:

lvextend --size [size] [device]
resize2fs [device] [size]

To shrink/reduce a partition:

resize2fs [device] [size]
lvreduce --size [size] [device]

Automatic Reboot after Kernel Panic (Ubuntu)

I don’t know why Ubuntu server doesn’t have this enabled by default, but you should add the following to /etc/sysctrl.conf:

kernel.panic=60

This will automatically reboot your server 60 seconds after a kernel panic.

fish:// and SSHFS

I’m probably the last KDE user to find out about this, but if you have access to an SSH server somewhere, open up Konqueror and type this in the address bar:

fish://your-server.com

It’s just like managing files on a remote Samba share, only it’s done completely over SSH!

Unfortunately, fish:// only works from within KDE applications, but that’s where SSHFS (Secure SHell FileSystem) comes in. With this tool, you can easily mount any remote filesystem over SSH for access by all of your applications. Goodbye FTP!

Some people may be interested in WinSCP, which provides similar functionality on Windows.