Next: About this document ...
Up: Redhat FAQ
Previous: 20 KRUD Updates
Contents
Subsections
- Rev:
- 08/08/02
- Use the text printconf program
# printconf-tui
- Rev:
- 4/24/01
To keep things simple use the same path for all users.
- Create a file called /etc/path with the following line:
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/X11R6/bin
- Comment out the PATH= line in /etc/profile and source the new path:
. /etc/path
export PATH
- If desired, add the user's home bin directory in their personl .bash_profile:
PATH=$PATH:$HOME/bin
- Rev:
- 12/12/02
The default colors are pretty awful. Expecially if you use white letters
on a black background as the default for a tty screen. To change the
colors on a per user basis:
- Change to your home directory
$ cd
- Run dircolors to generate a data file
$ dircolors -print-database >.dircolors
- Edit this newly created file to change colors. For example, to change
the color for directories from the default blue to an easier to see
yellow, change the line:
DIR 01;34
to:
DIR 01;33
- Add to .bash_profile the line:
eval `dircolors .dircolors`
- The above can be done globally by making changes in /etc/profile.
Sometimes because users are unable or simply unwilling to create good
passwords it becomes necessary to remove words from the cracklib dictionary.
Use the unpacker and packer utilites that are included withteh source
distribution of cracklib to do this.
- Unpack the current dictionary
$ unpacker /usr/lib/cracklib_dict >words
- Use a text editor to remove the desired text
- Repack the dictionary
$ sudo packer /usr/lib/cracklib_dict <words
- Copy to other machiunes as appropiate.
- If you have a GRUB password configured, type p and enter the password.
- Select Linux with the version of the kernel that you wish to boot
and type e for edit. You will be presented with a list of items in
the configuration file for the title you just selected.
- Select the line that starts with kernel and type e to edit the line.
- Go to the end of the line and type single as a separate word (press
the [Spacebar] and then type single). Press [Enter] to exit
edit mode.
- Back at the GRUB screen, type b to boot into single user mode.
- Rev:
- 03/11/02
- Unmount the partition
# umount /mp001
- Use tune2fs to create a journal on the partition
# tune2fs -j /dev/md0
- Mount the filesystem as ext3
mount -t ext3 /dev/md0 /mp001
- edit /etc/fstab to reflect the new filesystem type
- If possible, reboot to check that everything comes up correctly.
- Rev:
- 08/02/02
A boot floppy is often necessary to recover from a problem. Every
server should have one that is up to date.
- Put a formatted floppy in the drive
- Use mkbootdisk to create a boot disk
# mkbootdisk <kernel-version>
- Install the kernel-utils package if necessary.
- Use dmidecode
$ sudo dmidecode
- This produces a lot of output which can be parsed for various
values.
- Rev:
- 08/02/02
Redirect console to /dev/ttyS1 (COM2) for boot and normal operation
- Make sure that the kernel supports a serial console. This is the default
but may have been removed. In menuconfig:
Character Devices -> Standard/generic seriial port -> Support for
console on serial port.
- Install mgetty if necessary. It is not installed by default under
Redhat.
- In the globabl section of /etc/lilo.conf
- Add:
serial=1,9600n8
append=''console=ttyS1,9600''
- Delete or comment out:
message=/boot/message
- Run lilo to install the changes
- Add to /etc/inittab:
s1:12345:respawn:/sbin/mgetty -r -s 9600 ttyS1
- Reboot.
- Rev:
- 04/03/2001
This is only necesary if you intend to use X-Windowing. The following
assumes that xfs has already been set up which has been is standard
on Redhat systems since at least 6.2. All of the below must be done
with root privileges.
- Create a directory for the fonts
# mkdir /usr/share/fonts/ttf
- Change to the newly created directory
#cd /usr/share/fonts/ttf
- Extract the truetype fonts to the newly created directory
# tar -xvzf /<path to file>/truetype.tar.gz
- Create the fonts.scale file
# ttmkfdir -o fonts.scale
- Create the fonts.dir file
# mkfontdir
- Add the new fonts to xfs
# chkfontpath -add /usr/share/fonts/ttf
- Restart the X Fonts Server
# service xfs restart
- Exit and restart the X-server
- Rev:
- 12/12/01
$ sudo net join member -U <username>
These instruction are specific for the server Thames but can be adapted
to any samba server
- Log in onto thames
- Change to the directory /samba
$ cd /samba
- Edit the file win-accounts
$ vi win-accounts
Each line describes the account in the format:
<Username>:UserID>:<GroupID>:<First Name>:<Last Name>:<Additional
Groups>
The lines are sorted by user id so when adding a user, append a line
at the end of the file using the next available userid. For example,
add a user named ``Jim Jones'' who belongs to the marketing and
administratin groups. If the next avaialble User is 3560, the entry
will look something like:
jjones:3560:100:Jim:Jones:marketing,administration
- Once the entry is added, run the program ``makentaccounts'' (See:
21.11.4) passing the data file name as an argument.
This program reads the file and adds any users that do not already
exist. This must be done as root
$ sudo ./makentaccounts win-accounts
Right now, changes to user must be done by hand. Generally, only /etc/group
has to be changed when a user moves. If a user is deleted, run ``userdel''
and delete reference to the user in /etc/group. The user's original
home directory should be deleted, archived or have the ownership changed.
21.11.4 makentaccounts
#!/usr/bin/perl -w
# make user accounts for samba shares
# usage makentaccounts <data file> <target>
# read <path> from <data file>
# read usernames from <data file>
# if account does not already exist:
# set directory to <path>/username
# set ownership of directory to <username>:<group>
# set shell to bin/false
# make sure directory exists and has an all lowercase name
#
# data file format
# ignore comments (#) and blank lines
# PATH=<path> path to apply to subsequent names
# username:uid:gid:first:last:extra groups
use strict;
my $PASSWD = "/etc/passwd";
my (@passwd);
my ($file,$target,$path,$line);
my ($user,$uid,$gid,$first,$last,$grps);
# get the list of existing users
open FILE,$PASSWD or die "Unable to read $PASSWD\n";
foreach $line (<FILE>) {
($user,$grps) = split /:/,$line;
push @passwd,$user;
}
# open the data file
$file = $ARGV[0];
open FILE, $file or die "Unable to open $file for read.";
foreach $line (<FILE>) {
# clear leading and trailing whitespace and CR
$line =~ s/^\s+//;
$line =~ s/\s+$//;
$line =~ s/\n//;
# if a comment
if ($line =~ m/^\#/) { next; }
if ($line eq "") { next; }
# if PATH=
if ($line =~ m/PATH=(.+)/) {
# print "$line\n";
$path = $1;
# print "$1\n";
next;
}
# extract the fields
($user,$uid,$gid,$first,$last,$grps) = split /:/, $line;
# if the user already exists skip to next
if (grep /$user/,@passwd) {
# print "$user already exists\n";
next;
}
# create the user using -m to cause directory creation
system ("useradd -u $uid -g $gid -d $path/$user -c \"$first $last\" -s /bin/nologin -m $user\n");
# if there are supplementary groups defined, add them
if(defined $grps) {
system ("usermod -G $grps $user");
}
# set wnership on all files in the new directory
system ("chown -R $uid:$gid $path/$user\n");
}
close FILE;
Next: About this document ...
Up: Redhat FAQ
Previous: 20 KRUD Updates
Contents
2005-03-20