Access Without Pass

 

It's possible to acces others linux machines without having to enter the password each Time, especially when we need to automate tests or such as.

 

In the following, i explain what i Do:

 

1)

ssh-keygen -t rsa
2)

ssh-copy-id -i /home/nagios/.ssh/id_rsa.pub [email protected]

ssh-copy-id -i /home/account/.ssh/id_rsa.pub [email protected]

3)

ssh '[email protected]'

 

These actions consists on:

1) Creating the server public Key:  .ssh/id_rsa.pub

2) Copying the text on "id_rsa.pub" to the machine Client in: .ssh/authorized_keys 

 

Examples of Use:

ssh [email protected] /usr/../fileexec


/usr/local/nagios/libexec/check_by_ssh -t 120 -o  PreferredAuthentications=publickey -H 10.214.108.7 -l slev5r12 -C 'ls'

 

/usr/local/nagios/libexec/check_by_ssh -t 120 -o  PreferredAuthentications=publickey -H 10.214.108.7 -l slev5r12 -C 'ls /..path.. '

 

/usr/local/nagios/libexec/check_by_ssh -t 120 -o  PreferredAuthentications=publickey -H 10.214.108.7 -l slev5r12 -C '/export/home/slev5r12/nagios/sg_check_p3 -u slev5r12 -m check_p3_version'

 

Hope this Helps.

Wissem MEDIOUNI