POKE ME for any consultancy

Thursday, July 31, 2014

How do you set-up SSH with RSA public key authentication?

Step 1: Create Authentication SSH-Kegen Keys on – (192.168.1.1)
First login into server 192.168.1.1 with user tecmint and generate a pair of public keys using following command.
[tecmint@tecmint.com ~]$ ssh-keygen -t rsa

Generating public/private rsa key pair.
Enter file in which to save the key (/home/tecmint/.ssh/id_rsa): [Press enter key]
Created directory '/home/tecmint/.ssh'.
Enter passphrase (empty for no passphrase): [Press enter key]
Enter same passphrase again: [Press enter key]
Your identification has been saved in /home/tecmint/.ssh/id_rsa.
Your public key has been saved in /home/tecmint/.ssh/id_rsa.pub.
The key fingerprint is:
af:bc:25:72:d4:04:65:d9:5d:11:f0:eb:1d:89:50:4c tecmint@tecmint.com
The key's randomart image is:
+--[ RSA 2048]----+
|        ..oooE.++|
|         o. o.o  |
|          ..   . |
|         o  . . o|
|        S .  . + |
|       . .    . o|
|      . o o    ..|
|       + +       |
|        +.       |
+-----------------+
Step 2: Create .ssh Directory on – 192.168.1.2
Use SSH from server 192.168.1.1 to connect server 192.168.1.2 using agilis as user and create .ssh directory under it, using following command.
[tecmint@tecmint ~]$ ssh agilis@192.168.1.2 mkdir -p .ssh

The authenticity of host '192.168.1.2 (192.168.1.2)' can't be established.
RSA key fingerprint is d6:53:94:43:b3:cf:d7:e2:b0:0d:50:7b:17:32:29:2a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.2' (RSA) to the list of known hosts.
agilis@192.168.1.2's password: [Enter Your Password Here]
Step 3: Upload Generated Public Keys to – 192.168.1.2
Use SSH from server 192.168.1.1 and upload new generated public key (id_rsa.pub) on server 192.168.1.2 under agilis‘s .ssh directory as a file name authorized_keys.
[tecmint@tecmint ~]$ cat .ssh/id_rsa.pub | ssh agilis@192.168.1.2 'cat >> .ssh/authorized_keys'

agilis@192.168.1.2's password: [Enter Your Password Here]
Step 4: Set Permissions on – 192.168.1.2
Due to different SSH versions on servers, we need to set permissions on .ssh directory and authorized_keys file.
[tecmint@tecmint ~]$ ssh agilis@192.168.1.2 "chmod 700 .ssh; chmod 640 .ssh/authorized_keys"

agilis@192.168.1.2's password: [Enter Your Password Here]
Step 5: Login from 192.168.1.1 to 192.168.1.2 Server without Password
From now onwards you can log into 192.168.1.2 as agilis user from server 192.168.1.1 as tecmint user without password.

[tecmint@tecmint ~]$ ssh agilis@192.168.1.2

How To Reset root Password in Linux

It happens sometime that you can’t remember root password. On Linux, recovering root password can be done by booting Linux under a specific mode: single user mode.
This tutorial will show how to boot Linux in single user mode when using GRUB and finally how to change root password.
During normal usage, a Linux OS runs under runlevels between 2 and 5 which corresponds to various multi-user modes. Booting Linux under runlevel 1 will allow one to enter into a specific mode, single user mode. Under such a level, you directly get a root prompt. From there, changing root password is a piece of cake.
1. Entering Runlevel 1

Some Linux distribution, such as Ubuntu for instance, offer a specific boot menu entry where it is stated “Recovery Mode” or “Single-User Mode”. If this is your case, selecting this menu entry will boot your machine into single user mode, you can carry on with the next part. If not, you might want to read this part.
Using GRUB, you can manually edit the proposed menu entry at boot time. To do so, when GRUB is presenting the menu list (you might need to press ESC first), follow those instructions:
use the arrows to select the boot entry you want to modify.
press e to edit the entry
use the arrows to go to kernel line
press e to edit this entry
at the end of the line add the word single
press ESC to go back to the parent menu
press b to boot this kernel
The kernel should be booting as usual (except for the graphical splash screen you might be used to), and you will finally get a root prompt (sh#).
Here we are, we have gained root access to the filesystem, let’s finally change the password.
2. Changing Root Password

As root, changing password does not ask for your old password, therefore running the command:
# passwd

will prompt you for your new password and will ask you to confirm it to make sure there is no typo.
That’s it, you can now reboot your box and gain root access again

Tuesday, July 29, 2014

ssh-password-less-login-with-dsa-publickey-authentication

Q. How do you set-up SSH with DSA public key authentication? I have Linux laptop called tom and remote Linux server called jerry. How do I setup DSA based authentication so I don’t have to type password?
A. DSA public key authentication can only be established on a per system / user basis only i.e. it is not system wide. You will be setting up ssh with DSA public key authentication for SSH version 2 on two machines:
#1 machine : your laptop called tom
#2 machine
 : your remote server called jerry
Command to type on your laptop/desktop (local computer)
First login to local computer called tom and type the following command.
Step #1: Generate DSA Key Pair
Use ssh-keygen command as follows:
$ ssh-keygen -t dsa
Output:
Enter file in which to save the key (/home/vivek/.ssh/id_dsa):  Press [Enter] key
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/vivek/.ssh/id_dsa.
Your public key has been saved in /home/vivek/.ssh/id_dsa.pub.
The key fingerprint is:
04:be:15:ca:1d:0a:1e:e2:a7:e5:de:98:4f:b1:a6:01 vivek@vivek-desktop
Caution: a) Please don’t enter any passphrase or enter a passphrase different from your account password and confirm the same.
b) The public key is written to /home/you/.ssh/id_dsa.pub.
c) The private key is written to /home/you/.ssh/id_dsa.
d) It is important you
 never-ever give out your private key.
Step #2: Set directory permission
Next make sure you have correct permission on .ssh directory:
$ cd
$ chmod 755 .ssh
Step #3: Copy public key
Now copy file ~/.ssh/id_dsa.pub on Machine #1 (tom) to remote server jerry as ~/.ssh/authorized_keys:
$ scp ~/.ssh/id_dsa.pub user@jerry:.ssh/authorized_keys
Command to type on your remote server called jerry
Login to your remote server and make sure permissions are set correct:
$ chmod 600 ~/.ssh/authorized_keys
Task: How do I login from client to server with DSA key?
Use scp or ssh as follows from your local computer:
$ ssh user@jerry
$ ssh user@remote-server.com
$ scp file user@jerry:/tmp


Monday, July 28, 2014

When to use what Testing tools?

1.) Unit test cases : All the unit test cases of the code should pass, you can use JUnit. TestNG
2.) Various code quality standards should satisfy a benchmark i.e
         a.) For code coverage you can use cobertura
         b.) Static code analysis : their are couple of tools findbug, checkstyle, pmd.
              You can use Sonar as well which consolidates a lot of things.
3.) API test : Fitness can be used for doing API testing
4.) Functional/Integration testing : Selenium/QTP/ can be used for it
5.) Performance testing : JMeter/load runner can be used for this

How can I reset my admin password in Collabnet Subversion edge?

Presumably your admin password has been changed to something else and you have forgotten it. The only way to reset this without deleting the database is to edit it directly (it's pretty easy).

Stop the Subversion Edge service on Windows or run the $ bin/csvn stop command on Linux/Solaris
Find your install directory (eg, c:\csvn). This will contain a folder named data which contains a file named "csvn-production-hsqldb.script". Open this file in a text editor.
Search for "'admin'" (with the single quotes) -- you should find a row that looks like this:
INSERT INTO USER VALUES(1,2,'admin user','admin@example.com',TRUE,
    '78989asdef7898abde4252aedcb4352','Super Administrator','admin')
Replace the long encrypted password field ("789...") with this: 21232f297a57a5a743894a0e4a801fc3
Save, and restart the Subversion Edge service.
admin/admin should work after that.

Thursday, July 3, 2014

Agile Methodology


Agile Methodology




SCRUM 







Task Board

Sprint Review:
  • 1-2 hours
  • per sprint/week