Jump to Navigation

079 - How to SSH without password

Secure Shell is a program to log into another computer over a network, to execute commands in a remote machine, and to move files from one machine
to another. It provides strong authentication and secure communications over insecure channels. It is a replacement for rlogin, rsh, rcp, and rdist.
SSH protects a network from attacks such as IP spoofing, IP source routing, and DNS spoofing. An attacker who has managed to take over a network
can only force ssh to disconnect. He or she cannot play back the traffic or hijack the connection when encryption is enabled.

  1. When using ssh’s slogin (instead of rlogin) the entire login session, including transmission of password, is encrypted; therefore it is almost impossible
    for an outsider to collect passwords. But here is the method to SSH remort server without Password this is based on generating access key.
  2. generate your public/private keys using ssh-keygen.
    [myServer]# ssh-keygen -t rsa
  3. Copy the id_rsa.pub to the .ssh directory of the remote host you want to logon to as authorized_keys
    [myServer]# cp is_rsa.pub ~/.ssh/authorized_keys
  4. You are commanding the sshd daemon on the remote machine to encrypt the connection with this public key and that
    this key is authorized for version 2 of the ssh protocol. Try using something secure like scp for this copying.
    [myServer]# scp ~/.ssh/id_rsa.pub userid@mydomain.com:~/.ssh/authorized_keys
  5. Your public key based authentication has been setup. You won’t be asked your password on the remote machine.
    However, you need a program that manages your keys for you called an agent. You need to start the agent,
    tell it your passphrase, and hook up to the agent whenever you need to connect to the remote machine.
Linux:


Main menu 2

Story | by Dr. Radut