Friday, October 30, 2009

AIX install/unintall software - ssh

In AIX, we can use smitty to install software.
To uninstall, we can use "smit remove"

I wanted to install ssh on a AIX machine. But some how smit failed, so I tried compiling openssh from source.
We can download the openssh source code and compile it on our AIX box. Openssh needs zlib and openssl needs to be installed prior to it (I compiled both of these).
It looks for zlib.h zconf.h file /usr/inlcude directory and zlib.a file in /usr/lib directory.

After that we need to add new service on the system. Refer http://blog.thilelli.net/post/2005/06/14/How-to-Add-a-New-sshd_adm-Service-on-AIX-5X for this.

How to start sshd?
"startsrc -s sshd" will start the daemon.
Use "lssrc -s sshd" to see if it's already running.

Another way to start is "/usr/sbin/sshd -de"

lslpp --> The lslpp command displays information about installed filesets or fileset updates.
Example
[root@re-aix02:/usr/local/etc] lslpp -l bos.rte.libc openssh.base.server
Fileset Level State Description
----------------------------------------------------------------------------
Path: /usr/lib/objrepos
bos.rte.libc 5.1.0.69 COMMITTED libc Library
openssh.base.server 4.1.0.1 COMMITTED Open Secure Shell Server


oslevel -> Reports the latest installed maintenance level of the system


Here is some more info about installing ssh using smit

Installing openSSH on 5.1, 5.2, and 5.3
At 5.1, 5.2, and 5.3, the installation of openssh itself is in installp format, but all the prerequisites (including openssl) can be installed using the same rpm -i commands (using the same 4.3.3. rpm packages). The installp format package can be downloaded from the following site:http://sourceforge.net/projects/openssh-aix After installing the prerequisites using the following commands,
1. rpm -i zlib-1.1.4-3.aix4.3.ppc.rpm
2. rpm -i prngd-0.9.23-3.aix4.3.ppc.rpm AIX 5.2 uses /dev/urandom
3. rpm -i openssl-0.9.7d-1.aix5.1.ppc.rpm
4. rpm -i openssl-devel-0.9.7d-1.aix5.1.ppc.rpm

use smitty installp to install the openssh filesets extracted from the tar file openssh-3.8.1p1_51.tar (for 5.1), openssh-3.8.1p1_52.tar (for 5.2), and openssh-3.8.1p1_53.tar (for 5.3). The following steps need to be followed to install openssh.


1. In the directory where the images are, run the command inutoc.
2. Run smitty install.
3. Select "Install and Update Software".
4. While in smitty do the following:
4.1 Select "Install Software".
4.2 Enter a dot (".") in the field for "INPUT device / directory for software" and press ENTER.
4.3 Enter openssh in the "SOFTWARE to install" field.
4.4 Scroll down to "Preview new LICENSE agreements?" and press tab key to change the field to yes. Read the license agreement.
4.5 Scroll down to "ACCEPT new license agreements?" and press tab to change the field to yes. Press ENTER to begin the software installation.

Where to get openssl?
The OpenSSH software is shipped on the AIX 5.3 Expansion Pack. This version of OpenSSH is compiled and packaged as installp packages using the openssh-3.8.p1 level of source code. The installp packages include the man pages and the translated message filesets. The OpenSSH program contained in the Expansion Pack CD-ROM media is licensed under the terms and conditions of the IBM® International Program License Agreement (IPLA) for Non-Warranted Programs.

Before installing the OpenSSH installp format packages, you must install the Open Secure Sockets Layer (OpenSSL) software that contains the encrypted library. OpenSSL is available in RPM packages on the AIX Toolbox for Linux® Applications CD, or you can also download the packages from the following AIX Toolbox for Linux Applications Web site:

http://www-1.ibm.com/servers/aix/products/aixos/linux/download.html

Because the OpenSSL package contains cryptographic content, you must register on the Web site to download the packages. You can download the packages by completing the following steps:

1. Click the AIX Toolbox Cryptographic Content link on the right side of the AIX Toolbox for Linux Applications Web site.
2. Click I have not registered before.
3. Fill in the required fields in the form.
4. Read the license and then click Accept License. The browser automatically redirects to the download page.
5. Scroll down the list of cryptographic content packages until you see openssl-0.9.6m-1.aix4.3.ppc.rpm under OpenSSL — SSL Cryptographic Libraries.
6. Click the Download Now! button for the openssl-0.9.6m-1.aix4.3.ppc.rpm.

After you download the OpenSSL package, you can install OpenSSL and OpenSSH.

Thursday, October 15, 2009

mount: server:path failed, reason given by server: Permission denied

We get this peculiar NFS moount problem for quite a few reasons. But recently we encountered this problem and scratched our head debugging it. We tried restarting nfs server (service nfs restart), exportfs, validating /etc/export of server. Nothing solved the issue

engweb:/mnt/kits# mount -a
mount: library-hq:/export/kits/ failed, reason given by server: Permission denied
mount: library-hq:/export2/kits/ failed, reason given by server: Permission denied


But the actual issue is root partition (/) was full in the machine which hosted nfs server. After clearing the disk space everything got resolved.

Wednesday, October 14, 2009

How to access CD from LINUX installed in VMWare Virtual machine?

In VMware workstation click on VM -> Settings -> CD-ROM.
Make sure check boxes "Connected" and "Connect at power on" are ticked.
Then restart the Linux machine availble in VM.

After this you need to mount CDROM to one of your local location.
Find out in your machine where CDROM device is available.
>>> dmesg|grep -i cdrom
hdc: Vmware Virtual IDE CDROM Drive, ATAPI CD/DVD-ROM drive

From above output, in my machine it is available in /dev/hdc.

Now mount it to a local location "/mnt/cdrom". Make sure this directory is already created.

>>> mount /dev/hdc /mnt/cdrom
mount: block device /dev/hdc is write-protected, mounting read-only

Thats it. Now you can access the CD contents from /mnt/cdrom.