Siddesh BG's Build Release Config mgmt Blog

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Friday, 30 October 2009

AIX install/unintall software - ssh

Posted on 01:17 by Unknown
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.
Read More
Posted in AIX | No comments

Thursday, 15 October 2009

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

Posted on 22:46 by Unknown
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.
Read More
Posted in NFS | No comments

Wednesday, 14 October 2009

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

Posted on 07:26 by Unknown
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.
Read More
Posted in linux | No comments

Saturday, 26 September 2009

List of useful mysql commands

Posted on 05:19 by Unknown
Lets start with mysql database administration commands.
1) /bin/mysql -h hostname -u root -p #To login
2) SHOW DATABASES; # List all databases
3) DROP TABLE [table name]; #To delete a table
4) To create a new user - Login as root, switch to mysql db, make the user, update privileges
mysql) USE mysql;
mysql) INSERT INTO USER (Host, User, Password) VALUES ('%', 'username', PASSWORD('Password'));
mysql) flush privileges;
5)To change a password
/bin/mysqladmin -u username -h hostname -p password 'new-password'
or
mysql> SET PASSWORD FOR 'User'@'hostname'=PASSWORD('Passwd');
mysql> flush privileges;
6) To list available users - Login as root;
Use mysql;
SELECT USER FROM user;
SELECT USER,PASSWORD FROM user; #To know whether password is set fot users

Here are some more use full commands

1) CREATE DATABASE 134a;
2) DROP DATABASE 134a;
3) USE 134a;
4) CREATE TABLE president (
last_name VARCHAR(15) NOT NULL,
first_name VARCHAR(15) NOT NULL,
state VARCHAR(2) NOT NULL,
city VARCHAR(20) NOT NULL,
birth DATE NOT NULL DEFAULT '0000-00-00',
death DATE NULL
);
5) SHOW TABLES; #list tables
6) DESCRIBE president; #to view structure of table
7) INSERT INTO president VALUES ('Washington','Bush','George', 'VA', 'New York', '19320212', '19991214');
8) SELECT * FROM president;
9) SELECT * FROM president WHERE state="VA"; #selecting rows by using WHERE clause
10) SELECT state,first_name,last_name FROM president; #selecting specific columns
11) DELETE FROM president WHERE first_name="George"; # Deleting selected row
12) UPDATE president SET state="CA" WHERE first_name="George"; #Modify entries
13) LOAD DATA LOCAL INFILE 'president_db' INTO TABLE president; #Loading your data from a file into a table. Also try "mysql -u USERNAME -p < my_mysql_file
14) SELECT * FROM president WHERE death=NULL; # or WHERE death IS NULL #list president who are alive
15) SELECT last_name, birth FROM president WHERE birth < '1800-09-01';
16) SELECT last_name, birth FROM president ORDER BY birth ASC LIMIT 1; #select president who was born first
17) SELECT state, count(*) AS times FROM president GROUP BY state ORDER BY times DESC LIMIT 5; # Names of first 5 states in which the greatest number of presidents have been born
18) SELECT * FROM president WHERE (YEAR (now())-YEAR(birth)) < 60; #President who have been born in last 60 years
19) SELECT last_name, birth, death, FLOOR ((TO_DAYS(death)-TO_DAYS(birth))/365) AS age FROM president WHERE death IS NOT NULL ORDER BY age DESC LIMIT 10; #President who have died by their age in descending order
20) SELECT last_name, address, test_date, score FROM test, student WHERE test.ssn = student.ssn;

You can refer mysql.com/documentation/index.html and
mysql.com/documentation/bychapter/manual_Introduction.html for more details
Read More
Posted in mysql | No comments

Wednesday, 16 September 2009

How to redirect stdout & stderr to a file using tee?

Posted on 03:44 by Unknown
ant -f build-release.xml dist 2>&1 |tee /tmp/tt
Read More
Posted in commands | No comments

Sunday, 23 August 2009

Installing custom modules in Drupal

Posted on 02:42 by Unknown
1) Download the module from drupal website which you are interested and place it in apps\drupal\htdocs\sites\all\modules.
For Ex: I wanted to install Pathauto module, I downloaded it from http://drupal.org/project/pathauto and placed it in C:\Program Files\BitNami Drupal 6 Stack\apps\drupal\htdocs\sites\all\modules.

2) Extract it and read README.txt and INSTALL.txt files once.

3) Enable the module in the administration tools in drupal(i.e Administer -> Modules -> tick the downloaded module -> Click save Configuration)
Read More
Posted in Drupal | No comments

Thursday, 9 July 2009

How to use an external variable inside awk command?

Posted on 04:15 by Unknown
Some times we need to pass external shell variables inside awk statement. Here is a way to do it

suppose I want to use $user in my awk command
$ export user=uid #$user is defined

Pass it to awk command with -v option

$ cat /etc/passwd|tail -1|awk -v var=$user -F":" '{print "Your " var " is " $1}'

o/p: Your uid is guruss1
Read More
Posted in awk | No comments
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Popular Posts

  • 0509-036 Cannot load program p4 because of the following errors
    Here is the full description of error ............ bash-3.00# p4 info exec(): 0509-036 Cannot load program p4 because of the following error...
  • fortifyclient uploadFPR An internal error has occurred
    When you try to upload a .fpr file to Fortify 360 server and you get the below mentioned error. Then, this blog provides one of the route ca...
  • Unable to resolve target system name - a DNS problem
    I was not able to ping to any machines from my Windows 2003 server. I did following steps to debug & resolve the issue, which was relate...
  • jenkins error: java.io.IOException: Authentication method password not supported by the server at this stage
    When I tried to add a node to jenkins/hudson using ssh as launch method, the authentication keeps on failing with the below error. [12/15/11...
  • Posting a JIRA bug using Perl Mechanize
    Perl provides modules which can be used as command line browser to automate tasks dependent on web pages. Among them LWP and mechanize are i...
  • Installing and configuring Fortify on Linux and Windows machines
    Installing Fortify on Linux (RHEL 5 32 bit) Download Fortify archive Fortify-360-2.6.5-Analyzers_and_Apps-Linux-x86.tar.gz and extract it to...
  • Perforce and cygwin
    Are you a command-line freak ? Do you want your automated shell scripts to run on Windows ? Do you wish to work with Perforce commands on Cy...
  • Perforce - can't edit exclusive file already opened
    In perforce, whenever a binary file like doc, xls or ppt files are checked out, it is opened in exclusive lock mode. So no other person can ...
  • Solution to Project Euler Problem 10 - Find the sum of all the primes below two million
    http://projecteuler.net/problem=10 Problem The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two mi...
  • AIX: make: 1254-055 Dependency line needs colon or double
    We get this compilation issue "make: 1254-055 Dependency line needs colon or double" while compiling C/C++ code in AIX machines. I...

Categories

  • AIX
  • AIX ssh
  • ANT
  • apache
  • appliance
  • awk
  • branching
  • build-failures
  • cgi-perl
  • code-signing
  • commands
  • continuous Integration
  • cvs
  • cygwin
  • DNS
  • Drupal
  • EPM
  • euler
  • Fortify
  • hadoop
  • hpux
  • html
  • InstallShield
  • iptables
  • iso
  • jenkins-hudson
  • Jira
  • kiwi
  • linux
  • Makefile
  • maven
  • Miscellaneous
  • mysql
  • nexus
  • NFS
  • package
  • Perforce
  • Perl
  • php
  • rbuilder
  • rpath
  • rpm
  • rsync
  • Solaris
  • ssh
  • SuseStudio
  • tinderbox
  • unix
  • Visual studio 2008
  • vmware
  • war
  • webserver
  • wget
  • windows
  • xterm

Blog Archive

  • ▼  2013 (12)
    • ▼  December (1)
      • How to restart windows from command line ?
    • ►  July (2)
    • ►  April (2)
    • ►  March (2)
    • ►  February (3)
    • ►  January (2)
  • ►  2012 (43)
    • ►  December (2)
    • ►  November (1)
    • ►  October (4)
    • ►  September (7)
    • ►  August (5)
    • ►  July (4)
    • ►  June (2)
    • ►  May (3)
    • ►  April (4)
    • ►  March (3)
    • ►  February (1)
    • ►  January (7)
  • ►  2011 (23)
    • ►  December (4)
    • ►  November (9)
    • ►  October (4)
    • ►  September (1)
    • ►  June (2)
    • ►  May (1)
    • ►  April (1)
    • ►  March (1)
  • ►  2010 (15)
    • ►  December (2)
    • ►  November (1)
    • ►  September (3)
    • ►  April (1)
    • ►  February (6)
    • ►  January (2)
  • ►  2009 (28)
    • ►  November (5)
    • ►  October (3)
    • ►  September (2)
    • ►  August (1)
    • ►  July (1)
    • ►  June (5)
    • ►  May (3)
    • ►  April (1)
    • ►  February (2)
    • ►  January (5)
  • ►  2008 (20)
    • ►  December (6)
    • ►  November (3)
    • ►  October (1)
    • ►  September (1)
    • ►  July (8)
    • ►  June (1)
Powered by Blogger.

About Me

Unknown
View my complete profile