Add SSH Without Password

From HyperSecurity Wiki
Jump to: navigation, search

Client Side

  1. Generate your SSH encryption key pair for the filecopy account. Press the Enter key each time you are prompted for a password to be associated with the keys. (Do not enter a password.)
    • ssh-keygen -t dsa
  2. These keyfiles are stored in the.ssh subdirectory of your home directory. View the contents of that directory. The file named id_dsa is your private key, and id_dsa.pub is the public key that you will be sharing with your target server. Versions other than RedHat/Fedora may use different filenames, use the SSH man pages to verify this.
    • cd ~/.ssh/
  3. Copy the */only/* public key to the home directory of the account to which you will be sending the file.
    • scp id_dsa.pub root@hostname:/root/.ssh/

Server Side

  1. Log into the server that you will be connecting to via SSH/SCP.
  2. Goto the the following directory:
    • cd ~/.ssh/
  3. Once you are in the .ssh directory, type the following command:
    • cat id_dsa.pub >> authorized_keys
  4. Then type the following to delete the old client key:
    • rm -rf id_dsa.pub 
  5. Done