Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Для включение защиты по PIN-коду  установите пакет ssh-askpass:
    Code Block
    languagebash
    $ sudo apt-get install ssh-askpass
  2. Укажем Для того, чтобы запрашивался PIN-код, укажите ssh-agent что необходимо запрашивать пин-код. Выполним команду:
    Code Block
    languagebash
    $ eval "$(ssh-agent -s; SSH_ASKPASS=/usr/bin/ssh-askpass)"
  3. Генерируем ключиДля генерации ключей:
    Code Block
    languagebash
    $ ssh-keygen -t ecdsa-sk -O resident -O application=ssh:YourTextHere -O verify-required
    Generating public/private ecdsa-sk key pair.
    You may need to touch your authenticator to authorize key generation.
    Enter file in which to save the key (/home/tester/.ssh/id_ecdsa_sk): 
    /home/tester/.ssh/id_ecdsa_sk already exists.
    Overwrite (y/n)? y
    Enter passphrase (empty for no passphrase): 
    Enter same passphrase again: 
    Your identification has been saved in /home/tester/.ssh/id_ecdsa_sk
    Your public key has been saved in /home/tester/.ssh/id_ecdsa_sk.pub
    The key fingerprint is:
    SHA256:/vIIfHBajgeOHYoMjbzaE2eUoXU40jwSALfpuHjr9YA tester@tester2310
    The key's randomart image is:
    +-[ECDSA-SK 256]--+
    |+.o+ .           |
    | .ooO .          |
    |  o= *           |
    |.=. o            |
    |+.o.  + S        |
    |.+ooo* @         |
    |o.E+= B =        |
    |.o.o o +.o       |
    |..+.  . .oo      |
    +----[SHA256]-----+
  4. Копируем открытый ключ на сервер
    Code Block
    languagebash
    $ ssh-copy-id -i /home/tester/.ssh/id_ecdsa_sk.pub tester@192.168.88.129
    /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/tester/.ssh/id_ecdsa_sk.pub"
    /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
    /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
    tester@192.168.88.129's password: 
    
    Number of key(s) added: 1
    
    Now try logging into the machine, with:   "ssh 'tester@192.168.88.129'"
    and check to make sure that only the key(s) you wanted were added.

...