Sunday, January 14, 2007

How to check SSA card serial number

View SSA Serial No.:

# ssa_ela -h 3
ssa3 SRN 42521

Howto recovery from an unknow Root password

TITLE : Howto recovery from an unknow Root password
OS LEVEL : AIX 4.x and above

----------------------------------------------------------------------------

1. Boot the machine into 'service' mode from the installation media. Ensure
the CD/tape is in the appropriate drive, turn the keyswitch to 'service'
mode and boot the machine.
2. At the first screen, "Please Define the System Console", type a 1 and
press enter.
3. At the next screen, type 1 and press enter to have English during install.
4. At the next screen, "Welcome to Base Operating System Installation and
Maintenance", select 3 - Start Maintenance Mode for System Recovery.
5. At the "Maintenance" screen, select 1 - Access a Root Volume Group.
6. At the "Warning" screen, press 0 to continue.
7. At the screen, "Access a Root Volume Group", select the number for the
Root Volume Group to display the LV information and press enter.
8. At the "Volume Group Information" screen, select 2 -Access this Volume
Group and start a shell before mounting filesystems.
9. At the root prompt, type 'exit' to continue the process of accessing the
root volume group.
10. At the next prompt, set the TERM variable, using:

TERM=vt100 export TERM (where vt100 is the emulation used)

11. At the next prompt, change the root password, using:

passwd

You will then be prompted for a new root password. You will be asked
to enter it a 2nd time to confirm.

12. Shutdown and reboot the system in normal mode. Turn the keyswitch to
'normal' mode and type:

shutdown -Fr

Solaris login check

To check the status of the UNIX account.

# /usr/bin/logins -aoxl username

Checking disk mapping in Linux system

Below is the command to check the correct PV to scsi mapping in the Linux system:

# scsiinfo -a /dev/sda1

Checking Solaris hardware component

I've learned the command to check and verify Solaris's hardware component including ram, processor details, system model and architecture, network and etc. The command is the following below:

# /usr/platform/`uname -m`/sbin/prtdiag

Wednesday, January 10, 2007

Using public keys for SSH authentication

Source taken from http://www.putty.nl/0.58/htmldoc/Chapter8.html#pubkey

Public key authentication - an introduction

Public key authentication is an alternative means of identifying yourself to a login server, instead of typing a password. It is more secure and more flexible, but more difficult to set up.

In conventional password authentication, you prove you are who you claim to be by proving that you know the correct password. The only way to prove you know the password is to tell the server what you think the password is. This means that if the server has been hacked, or spoofed (see section 2.2), an attacker can learn your password.

Public key authentication solves this problem. You generate a key pair, consisting of a public key (which everybody is allowed to know) and a private key (which you keep secret and do not give to anybody). The private key is able to generate signatures. A signature created using your private key cannot be forged by anybody who does not have that key; but anybody who has your public key can verify that a particular signature is genuine.

So you generate a key pair on your own computer, and you copy the public key to the server. Then, when the server asks you to prove who you are, PuTTY can generate a signature using your private key. The server can verify that signature (since it has your public key) and allow you to log in. Now if the server is hacked or spoofed, the attacker does not gain your private key or password; they only gain one signature. And signatures cannot be re-used, so they have gained nothing.

There is a problem with this: if your private key is stored unprotected on your own computer, then anybody who gains access to that will be able to generate signatures as if they were you. So they will be able to log in to your server under your account. For this reason, your private key is usually encrypted when it is stored on your local machine, using a passphrase of your choice. In order to generate a signature, PuTTY must decrypt the key, so you have to type your passphrase.

This can make public-key authentication less convenient than password authentication: every time you log in to the server, instead of typing a short password, you have to type a longer passphrase. One solution to this is to use an authentication agent, a separate program which holds decrypted private keys and generates signatures on request. PuTTY's authentication agent is called Pageant. When you begin a Windows session, you start Pageant and load your private key into it (typing your passphrase once). For the rest of your session, you can start PuTTY any number of times and Pageant will automatically generate signatures without you having to do anything. When you close your Windows session, Pageant shuts down, without ever having stored your decrypted private key on disk. Many people feel this is a good compromise between security and convenience. See chapter 9 for further details.

There is more than one public-key algorithm available. The most common is RSA, but others exist, notably DSA (otherwise known as DSS), the USA's federal Digital Signature Standard. The key types supported by PuTTY are described in section 8.2.2.

For Unix, what are ssh-agent and ssh-add, and how do I use them?

Source taken from http://kb.iu.edu/data/aeww.html

In Unix, ssh-agent is a background program that handles passwords for SSH private keys. The ssh-add command prompts the user for a private key password and adds it to the list maintained by ssh-agent. Once you add a password to ssh-agent, you will not be prompted for it when using SSH or scp to connect to hosts with your public key.

To use ssh-agent and ssh-add, follow the steps below:

  1. At the Unix prompt, enter: eval `ssh-agent` Note: Make sure you use the backquote ( ` ), located under the tilde ( ~ ), rather than the single quote ( ' ).

  2. Enter the command: ssh-add
  3. Enter your private key password.

  4. When you log out, enter the command: kill $SSH_AGENT_PID To run this command automatically when you log out, place it in your .logout file (if you are using csh or tcsh) or your .bash_logout file (if you are using bash).

Note: The versions of these programs for SSH2, ssh-agent2 and ssh-add2, are the same as outlined above. To use them, follow the instructions above, replacing all occurrences of ssh-agent with ssh-agent2 , and ssh-add with ssh-add2 . The SSH2 versions will only work if both your computer and the remote host are running SSH2.