Ssh

Матеріал з Wiki Welard
Перейти до навігації Перейти до пошуку

Щоб при вході на linux машину через ssh авторизувало по ключу

   1 opened up puttygen.exe
   2 generated a key after wiggling your mouse
     entered a strong passphrase
     saved the public key to something like
     pubkey
   3 saved the private key to something like
     privatekey.ppk
   4 moved your public key up to the server
    (maybe even) converted the format of the key from putty to openssh with something like
     ssh-keygen -if pubkey > pubkey_openssh_format
   5 changed some permissions like
     chmod 600 .ssh
   6 added your pubkey to the authorized_keys file with something like
     mv pubkey .ssh/authorized_keys
   7 changed your putty settings under "connection > SSH > auth" to use
     privatekey.ppk
   8 tried to connect and...

То все круто, але ніхрена не працює в CentOS. Робимо по іншому:

     chmod 600 authorized_keys

chmod 700 .ssh

     if they are wrong
  • Генеруэмо ключі

ssh-keygen -t dsa (або можна rsa)

  • можна додатково парольну фразу, але навіщо?
  • SSH під тим користувачем робимо
cat id_dsa.pub > ~/.ssh/authorized_keys
  • копіємо собі на локальну машину private key (id_dsa)
  • запкуск puttygen.exe
  • Загружаємо "load" id_dsa файл
  • Зберігаємо конвертований ключ pivatekey.ppk
  • В putty налаштування "connection > SSH > auth" -> privatekey.ppk і все!!!


   * NOW try and connect
   * enter the passphrase when prompted
   * pat yourself on the back. You're connected to the server (I hope)