Categories
Linux

ChangePassword for Linux compilation error

ChangePassword for Linux compilation error

ChangePassword is the web CGI that allow the user to change their password thru the http/web instead of telner/SSH into the system in order to change their password. The installation source file can be found from http://changepassword.sourceforge.net/

Basically the configuration and compilation is simple as below:

1. Run ./configure

Example:

./configure –enable-cgidir=/var/www/cgi-bin –enable-smbpasswd=/usr/local/samba/private/smbpasswd –disable-squidpasswd
–enable-logo=brain-cluster.jpg

2) run “make”
3) run  “make install”
4) copy the logo file (if set by –enable-logo option) to the website root htdocs folder

 

Problem: Error in compilation

You might encounter error during the “make” step for certain Linux distribution/version. Below is the error:

suse10:~/changepassword-0.9 # make
gcc -c -o smbencrypt/SMBPasswdGen.o  smbencrypt/SMBPasswdGen.c
gcc -c -o smbencrypt/encrypt.o       smbencrypt/encrypt.c
gcc -c -o smbencrypt/md4.o           smbencrypt/md4.c
gcc -c -o smbencrypt/smbencrypt.o    smbencrypt/smbencrypt.c
gcc changepassword.c -o changepassword.cgi smbencrypt/SMBPasswdGen.o smbencrypt/md4.o smbencrypt/smbencrypt.o smbencrypt/encrypt.o -lcrypt -DPACKAGE_NAME=\”\” -DPACKAGE_TARNAME=\”\” -DPACKAGE_VERSION=\”\” -DPACKAGE_STRING=\”\” -DPACKAGE_BUGREPORT=\”\” -DHAVE_LIBCRYPT=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_STDIO_H=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_PWD_H=1 -DHAVE_ERRNO_H=1 -DHAVE_SIGNAL_H=1 -DHAVE_SHADOW_H=1 -DHAVE_TIME_H=1  -DEnglish -DSMBPASSWD=\”no\” -DSQUIDPASSWD=\”no\” -DLOGO=\”giant_logo.jpg\” -L./smbencrypt -ldes
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: skipping incompatible ./smbencrypt/libdes.a when searching for -ldes
/usr/lib64/gcc/x86_64-suse-linux/4.1.2/../../../../x86_64-suse-linux/bin/ld: cannot find -ldes
collect2: ld returned 1 exit status
make: *** [changepassword.cgi] Error 1

Solution: Recompile libdes.a

This is due to the incompatible file named libdes.a. Below is the solution

suse10:~/changepassword-0.9 # cd  smbencrypt/
suse10:~/changepassword-0.9/smbencrypt # tar -xzvf libdes-4.04b.tar.gz
suse10:~/changepassword-0.9/smbencrypt # cd des/
suse10:~/changepassword-0.9/smbencrypt/des # make
suse10:~/changepassword-0.9/smbencrypt/des # cp libdes.a ..
suse10:~/changepassword-0.9/smbencrypt/des # cd ../..

run the “make” and “make install” again from the root of the changepassword installation source

suse10:~/changepassword-0.9 # make
suse10:~/changepassword-0.9 # make install

the compilation should be able to go thru.

 

Categories
VMware

Restore Acronis backup image into VMware

Restore Acronis backup image into VMware

Issue/Problem:

Restoring the backup image into VMware (or somether dissimilar harddware) might not work. The kernel might not able to detect the hard disk or root volume. Error like “waiting for device /dev/sda3 to appear”

Solution:

The solution below is tested to work in openSUSE 11.1 in  vmware player

1. Boot with rescue mode of the install CD and log in with root rights

2. Partition Listing
cat /proc/partitions
fdisk -l /dev/sda


Sample:

device      mount point
/dev/sda1     /boot
/dev/sda2     swap
/dev/sda3     /
/dev/sda4     /home

3. Unlock encrpted partitions (perform this if you have encrypted partition with LUKS
cryptsetup luksOpen /dev/sda3 root

4. Make the swap available
swapon /dev/sda2

5. Mount your file systems
Mount root file system
mount /dev/sda3 /mnt

Mount boot file system, if separate
mount /dev/sda1 /mnt/boot

Bind mount temporary file systems
mount –bind /dev /mnt/dev
mount –bind /proc /mnt/proc
mount –bind /sys /mnt/sys

Mount other partitions
mount /dev/sda4 /mnt/home

6.  Prepare and enter the new root
Copy your mounts and DNS resolution files (Optional)
cp /etc/mtab /mnt/etc/mtab
cp /etc/resolv.conf /mnt/etc/resolv.conf

Make the mount point the new root
chroot /mnt /bin/bash

7. Reload boot loader, if desired (Optional)

* Launch yast
* Navigate to System > Boot Loader
* Select boot loader installation
* Check Boot Loader Location > Boot from Master Boot Record

8. Include the nessesary drivers in /etc/sysconfig/kernel
to do this edit the section ‘ INITRD_MODULES=”…” ‘
ata_piix -> VMWare Mother board
mptspi -> VMWare lsi scsi
Example:
INITRD_MODULES=”processor thermal ata_piix fan ext3 edd mptspi”

9. Generate new initrd
cd /boot
mv initrd-<kernelversion> initrd-<kernelversion>.old
mkinitrd -d /dev/sda3

extra modules can also be added with the -m switch (e.g: mkinitrd -d /dev/sda3 -m mptspi )
more help on options : mkinitrd -h

10. Make sure the name of the created initrd is the same as stated in the menu.1st or that the initrd link points to the new initrd file.

11. Exit and reboot the system.

Note:
If using LVM:
# Executed “/sbin/vgscan”, then “/sbin/vgchange -ay” to make LVM volume/logical groups available
# Mounted my LVM-managed root dir via “mount /dev/mastervol/Suse10.1 /mnt”

References and Resources:

http://en.opensuse.org/Using_the_rescue_system_%28advanced%29

http://forums.opensuse.org/archives/sf-archives/archives-tips-tricks-tweaks/343785-good-things-know-when-imaging-linux-different-hardware.html

Categories
openSUSE

Atheros Wireless for openSUSE Linux

Atheros Wireless for openSUSE Linux

I tried to configure openSUSE 11.1 Linux into Acer Aspire 4530 laptop. Althought the ath9k was detected and installed successfully the openSUSE but performance/stability seem like not so great. It will hang when using aireplay-ng. I have to update it with the latest atheros driver.

How do I know which chipset I have?

The chipset is what determines which driver you need, not the manufacturer of the card. Here are a number of ways to find out. All the commands should be run as root.

 

Test this:

hwinfo –wlan

Otherwise use this command if you have a pcmcia card or an onboard card:

lspci

Or this if you have a usb card:

lsusb

This won’t output very detailed information, but it’ll give you a unique hardware ID, for example 046d:c01b. Search for it with Google or another internet search engine to find out which chipset is on the device.

Add latest wireless driver repository into your openSUSE system

sudo zypper addrepo –refresh http://download.opensuse.org/repositories/driver:/wireless/11.1-update/ Wireless
sudo zypper refresh
sudo zypper install Wireless:compat-wireless-kmp-default

Reference and Resource:

http://en.opensuse.org/HCL/Network_Adapters_%28Wireless%29

http://linuxwireless.org/en/users/Download#Building_and_installing