Category Archives: howto

Enable Root login through Telnet

Almost all Linux distributions now a days come with “root” login disabled through telnet. Some distributions doesn’t have telnet login service at all. This is generally a Good Thing, because telnet login needs passwords to be sent over the network in plain-text format. This has lots of security implications, like anybody snooping your network can read your password.

But still, sometimes you may need to enable root login through telnet. Below are steps to enable this for RHEL5 (GA).

1. Make sure you have xinetd and telnet-server packages installed on your box. You can verify this using below commands

    $ rpm -qa | grep xinetd
    $ rpm -qa | grep telnet-server

2. If you don’t have above packages installed (which is the case by default) download or copy those packages and install them using,

    # rpm -i xinetd*.rpm telnet-server*.rpm

command.

3. Now enable the xinetd service. To do this you need to run two commands

    # service xinetd start
    # chkconfig xinetd on

4. Now you can enable telnet service either using “serviceconf” GUI utility or by manually editing /etc/xinetd.d/telnet files.

5. By now telnet login service will be up and running on your box. But it is by default disabled for root user. You can enable it by appending pts/0, pts/1,…, pts/9, etc. entries into /etc/securetty file. Once you do this, you will be able to open 10 root sessions through telnet.

Have Fun.

Lucidatypewriter/Bitmap Fonts in Ubuntu

By default Ubuntu comes with bitmap fonts disabled in the system. Since lucidatypewriter is a bitmap font, it doesn’t show up in the font chooser windows. You need to enable bitmap fonts to use it.

To enable bitmap fonts, follow the below procedure.

1. Run the below command in the terminal, and choose “YES” when it asks for “enable bitmap fonts?” question. Choose the defaults for other queries.

        $ sudo dpkg-reconfigure fontconfig-confg

2. Once you do the above step, you should regenerate the font cache using below command.

        $ sudo dpkg-reconfigure fontconfig

3. Now you should logout and re-login. Now bitmap fonts start appearing on the font chooser dialog boxes.

Installing New TTF Fonts (non-root)

Here is a small notes on how to install ttf fonts as a non-root user. Below instructions are for installing liberation fonts from RedHat.You can follow the same for installing other fonts too.

1. Download the fonts first.

        cd $HOME
        wget https://www.redhat.com/f/fonts/liberation-fonts-ttf-3.tar.gz
        tar xzvf liberation-fonts-ttf-3.tar.gz

2. Create .fonts directory and copy the fonts

        mkdir .fonts
        cd .fonts

        mv ~/liberation-fonts-0.2 .
        cd liberation-fonts-0.2

3. Run these commands inside the fonts directory

        ttmkfdir > fonts.dir
        ttmkfdir > fonts.scale
        mkfontdir

4. Update the fonts cache

        xset fp+ $HOME/.fonts/liberation-fonts-0.2
        xset fp rehash

Enjoy the fonts.

Editing ISO Images

UPDATE: A software, isomaster, is available to do the same using graphical interface.

Today i need to add couple of softwares into RHEL 5 dvd iso image. Procedure is easy, but it was not straight. RHEL 5 dvd is a bootable dvd, which after boot-up starts the OS installation. My goal was, the modified dvd should also do the same. It should also boot and should install RHEL 5 on to the disk, just that it should contain additional software in it. Below is how i was able to do it:

1. Download the RHEL5 dvd iso image.

2. Mount the iso image on some directory, say isodir using below command

    mount -o loop RHEL5-DVD.iso isodir

3. These iso image files cannot be edited in-place, so i had to make a copy of the whole dvd into a new directory. I created a temporary directory, tmpdir and copied all files from isodir into tmpdir

    mkdir tmpdir
    cp -r isodir/* tmpdir/

4. RHEL 5 dvd contains a hidden file named .discinfo. You should copy that file also; without it, RHEL installer doesn’t recognize the dvd for OS installation.

    cp isodir/.discinfo tmpdir/

5. Copy the extra software that you want to bundle with the RHEL 5 dvd.

    cp extra-software tmpdir/

6. Now we have to create bootable dvd iso image again. You can use the below command to do this for RHEL 5 dvd. This step depends on what kind of bootloader the dvd uses. RHEL uses isolinux bootloader, and below command should do for all isolinux booting iso images.

    mkisofs -R -J -T -v -no-emul-boot -boot-load-size 4 \
    -boot-info-table -V "RHEL_5 i386 DVD (updated or whatever)" \
    -b isolinux/isolinux.bin -c isolinux/boot.cat -x "lost+found" \
    -o NEW-RHEL5-DVD.iso tmpdir

Fix Alt Key in XTerm

Add the below lines into $HOME/.Xdefaults file and execute “xrdb -merge $HOME/.Xdefaults” command. It will fix this problem. To make this permanent for all users, you can add the same lines into /etc/X11/app-defaults/XTerm file.

*VT100*utf8: 1
*VT100*eightBitInput: false
*VT100*eightBitControl: false
*VT100*eightBitOutput: true

Solaris Tips

Enable Serial Console

To enable serial console use

eeprom console=ttya

command and restart the system. Serial console can also be enabled using kernel’s command-line arguments. Just add

-B console=ttya

to the kernel command-line in /boot/grub/menu.lst file.

Recover Boot Archive

To recover from corrupted boot-archive problems, you should follow below steps:

1. Reboot your machine into ‘Solaris failover’ mode
2. Select your Solaris installation disk
3. Say yes for all filesystem correction steps until you get # prompt
4. Run

rm -f /a/platform/i86pc/boot_archive

command. It will remove you old boot-archive from the system.
5. Now run

bootadm update-archive -R /a

command. This will re-build completely new boot-archive for you system.

Extract cpio Archives

Normally

cpio -id archive-name

command will extract cpio archives. If the cpio archive is gzipped, then you can pipes as below:

gunzip -c archive-name | cpio -id

Remote Login for root

By default, Sun boxes come with remote login disabled for root. One has to manually enable remote login for root. To enable remote telnet access to root, comment out the

CONSOLE=/dev/console

line in /etc/default/login file.

For remote SSH access, change the “no” to “yes” in

PermitRootLogin no

line in /etc/ssh/sshd_config file. Also you need to restart the SSHD daemon using

svcadm restart ssh

command.

Delete Zones

You can list all the configured zones using

zoneadm list -cv

command. Deleting a zone involves uninstalling the zone and removing its configuration. To uninstall use

zoneadm -z zone-name uninstall -F

command. Without -F option, you will be asked for confirmation. Now you can delete the zone configuration using

zonecfg -z zone-name delete

command.

Printing Man pages

You can use

groff -t -man -Tps man-file | lp -dprinter-name

command to print man pages. Solaris 10 doesn’t come with groff package, so you need to install it. You can download groff from sunfreeware website.

UPDATE: from Jyothi’s blog, i found the below command for the same

TCAT=/usr/lib/lp/postscript/dpost man -t command | lp -P printer-name

ext2 from Solaris 10

Solaris doesn’t support ext2/ext3 filesystems out of the box. Here is how to do it:

1. Download the FSWfsmisc package from Belenix. It is available as Miscellaneous Filesystem package (NTFS, Ext2Fs) for OpenSolaris on their download page. Though it says for OpenSoalris it worked fine on Solaris 10.

2. Extract it using gunzip and tar xf into /tmp

3. Install the package (as root) using

pkgadd -d FSWfsmic

from /tmp directory. Now you can mount ext2/ext3 filesystems using

mount -F ext2fs device-file mount-directory

BTW, you need to learn about device naming format in Solaris