RSAKeyMan
From HPCC
Генерація ключів
Ключ RSA або DSA можна створити за допомогою утиліти ssh-keygen. Потрібно згенерувати ключі без захисту паролем, тому на запит "Enter passphrase:" слід просто натиснути Enter.
[test1@n001 ~]$ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/home/users/test1/.ssh/id_rsa): Created directory '/home/users/test1/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/users/test1/.ssh/id_rsa. Your public key has been saved in /home/users/test1/.ssh/id_rsa.pub. The key fingerprint is: 36:3c:90:53:b6:ff:19:23:fc:58:0e:a2:17:75:07:c6 test1@n001
Після створення ключів, потрібно додати їх у список довірених:
[test1@n001 ~]$ cat .ssh/id_rsa.pub > .ssh/authorized_keys
Увага! Потрібно прослідкувати, щоб на всі файли у директорії .ssh/ були правильні права та власники.
drwx------ user usergroup .ssh/ -rw-r--r-- user usergroup known_hosts -rw-r--r-- user usergroup id_rsa.pub -rw------- user usergroup id_rsa -rw-r--r-- user usergroup authorized_keys
Додавання вузлів у список відомих хостів
Можна скористатись готовим файлом /home/users/known_hosts, який потрібно скопіювати у директорію .ssh/, що у домашньому каталозі користувача, або згенерувати самостійно за допомогою наступної команди.
[test1@n001 ~]$ for i in `seq -w 1 112`; do ssh -o StrictHostKeyChecking=no n$i.kpi hostname; done; Warning: Permanently added 'n001.kpi,172.16.1.1' (RSA) to the list of known hosts. n001 Warning: Permanently added 'n002.kpi,172.16.1.2' (RSA) to the list of known hosts. n002 Warning: Permanently added 'n003.kpi,172.16.1.3' (RSA) to the list of known hosts. n003 Warning: Permanently added 'n004.kpi,172.16.1.4' (RSA) to the list of known hosts. n004 Warning: Permanently added 'n005.kpi,172.16.1.5' (RSA) to the list of known hosts. n005 Warning: Permanently added 'n006.kpi,172.16.1.6' (RSA) to the list of known hosts. n006 Warning: Permanently added 'n007.kpi,172.16.1.7' (RSA) to the list of known hosts. n007 Warning: Permanently added 'n008.kpi,172.16.1.8' (RSA) to the list of known hosts. n008 Warning: Permanently added 'n009.kpi,172.16.1.9' (RSA) to the list of known hosts. n009 Warning: Permanently added 'n010.kpi,172.16.1.10' (RSA) to the list of known hosts. n010 Warning: Permanently added 'n011.kpi,172.16.1.11' (RSA) to the list of known hosts. n011 Warning: Permanently added 'n012.kpi,172.16.1.12' (RSA) to the list of known hosts. n012 Warning: Permanently added 'n013.kpi,172.16.1.13' (RSA) to the list of known hosts. n013 Warning: Permanently added 'n014.kpi,172.16.1.14' (RSA) to the list of known hosts. n014 Warning: Permanently added 'n015.kpi,172.16.1.15' (RSA) to the list of known hosts. n015 Warning: Permanently added 'n016.kpi,172.16.1.16' (RSA) to the list of known hosts. n016 Warning: Permanently added 'n017.kpi,172.16.1.17' (RSA) to the list of known hosts. n017 Warning: Permanently added 'n018.kpi,172.16.1.18' (RSA) to the list of known hosts. n018 Warning: Permanently added 'n019.kpi,172.16.1.19' (RSA) to the list of known hosts. n019 Warning: Permanently added 'n020.kpi,172.16.1.20' (RSA) to the list of known hosts. n020 Warning: Permanently added 'n021.kpi,172.16.1.21' (RSA) to the list of known hosts. n021 Warning: Permanently added 'n022.kpi,172.16.1.22' (RSA) to the list of known hosts. n022 Warning: Permanently added 'n023.kpi,172.16.1.23' (RSA) to the list of known hosts. n023 Warning: Permanently added 'n024.kpi,172.16.1.24' (RSA) to the list of known hosts. n024 Warning: Permanently added 'n025.kpi,172.16.1.25' (RSA) to the list of known hosts. n025 Warning: Permanently added 'n026.kpi,172.16.1.26' (RSA) to the list of known hosts. n026 Warning: Permanently added 'n027.kpi,172.16.1.27' (RSA) to the list of known hosts. n027 Warning: Permanently added 'n028.kpi,172.16.1.28' (RSA) to the list of known hosts. n028 Warning: Permanently added 'n029.kpi,172.16.1.29' (RSA) to the list of known hosts. n029 Warning: Permanently added 'n030.kpi,172.16.1.30' (RSA) to the list of known hosts. n030 Warning: Permanently added 'n031.kpi,172.16.1.31' (RSA) to the list of known hosts. n031 Warning: Permanently added 'n032.kpi,172.16.1.32' (RSA) to the list of known hosts. n032 Warning: Permanently added 'n033.kpi,172.16.1.33' (RSA) to the list of known hosts. n033 Warning: Permanently added 'n034.kpi,172.16.1.34' (RSA) to the list of known hosts. n034 Warning: Permanently added 'n035.kpi,172.16.1.35' (RSA) to the list of known hosts. n035 Warning: Permanently added 'n036.kpi,172.16.1.36' (RSA) to the list of known hosts. n036 Warning: Permanently added 'n037.kpi,172.16.1.37' (RSA) to the list of known hosts. n037 Warning: Permanently added 'n038.kpi,172.16.1.38' (RSA) to the list of known hosts. n038 Warning: Permanently added 'n039.kpi,172.16.1.39' (RSA) to the list of known hosts. n039 Warning: Permanently added 'n040.kpi,172.16.1.40' (RSA) to the list of known hosts. n040 Warning: Permanently added 'n041.kpi,172.16.1.41' (RSA) to the list of known hosts. n041 Warning: Permanently added 'n042.kpi,172.16.1.42' (RSA) to the list of known hosts. n042 Warning: Permanently added 'n043.kpi,172.16.1.43' (RSA) to the list of known hosts. n043 Warning: Permanently added 'n044.kpi,172.16.1.44' (RSA) to the list of known hosts. n044 Warning: Permanently added 'n045.kpi,172.16.1.45' (RSA) to the list of known hosts. n045 Warning: Permanently added 'n046.kpi,172.16.1.46' (RSA) to the list of known hosts. n046 Warning: Permanently added 'n047.kpi,172.16.1.47' (RSA) to the list of known hosts. n047 Warning: Permanently added 'n048.kpi,172.16.1.48' (RSA) to the list of known hosts. n048 Warning: Permanently added 'n049.kpi,172.16.1.49' (RSA) to the list of known hosts. n049 Warning: Permanently added 'n050.kpi,172.16.1.50' (RSA) to the list of known hosts. n050 Warning: Permanently added 'n051.kpi,172.16.1.51' (RSA) to the list of known hosts. n051 Warning: Permanently added 'n052.kpi,172.16.1.52' (RSA) to the list of known hosts. n052 Warning: Permanently added 'n053.kpi,172.16.1.53' (RSA) to the list of known hosts. n053 Warning: Permanently added 'n054.kpi,172.16.1.54' (RSA) to the list of known hosts. n054 Warning: Permanently added 'n055.kpi,172.16.1.55' (RSA) to the list of known hosts. n055 Warning: Permanently added 'n056.kpi,172.16.1.56' (RSA) to the list of known hosts. n056 Warning: Permanently added 'n057.kpi,172.16.1.57' (RSA) to the list of known hosts. n057 Warning: Permanently added 'n058.kpi,172.16.1.58' (RSA) to the list of known hosts. n058 Warning: Permanently added 'n059.kpi,172.16.1.59' (RSA) to the list of known hosts. n059 Warning: Permanently added 'n060.kpi,172.16.1.60' (RSA) to the list of known hosts. n060 Warning: Permanently added 'n061.kpi,172.16.1.61' (RSA) to the list of known hosts. n061 Warning: Permanently added 'n062.kpi,172.16.1.62' (RSA) to the list of known hosts. n062 Warning: Permanently added 'n063.kpi,172.16.1.63' (RSA) to the list of known hosts. n063 Warning: Permanently added 'n064.kpi,172.16.1.64' (RSA) to the list of known hosts. n064 Warning: Permanently added 'n065.kpi,172.16.1.65' (RSA) to the list of known hosts. n065 Warning: Permanently added 'n066.kpi,172.16.1.66' (RSA) to the list of known hosts. n066 Warning: Permanently added 'n067.kpi,172.16.1.67' (RSA) to the list of known hosts. n067 Warning: Permanently added 'n068.kpi,172.16.1.68' (RSA) to the list of known hosts. n068 Warning: Permanently added 'n069.kpi,172.16.1.69' (RSA) to the list of known hosts. n069 Warning: Permanently added 'n070.kpi,172.16.1.70' (RSA) to the list of known hosts. n070 Warning: Permanently added 'n071.kpi,172.16.1.71' (RSA) to the list of known hosts. n071 Warning: Permanently added 'n072.kpi,172.16.1.72' (RSA) to the list of known hosts. n072 Warning: Permanently added 'n073.kpi,172.16.1.73' (RSA) to the list of known hosts. n073 Warning: Permanently added 'n074.kpi,172.16.1.74' (RSA) to the list of known hosts. n074 Warning: Permanently added 'n075.kpi,172.16.1.75' (RSA) to the list of known hosts. n075 Warning: Permanently added 'n076.kpi,172.16.1.76' (RSA) to the list of known hosts. n076 Warning: Permanently added 'n077.kpi,172.16.1.77' (RSA) to the list of known hosts. n077 Warning: Permanently added 'n078.kpi,172.16.1.78' (RSA) to the list of known hosts. n078 Warning: Permanently added 'n079.kpi,172.16.1.79' (RSA) to the list of known hosts. n079 Warning: Permanently added 'n080.kpi,172.16.1.80' (RSA) to the list of known hosts. n080 Warning: Permanently added 'n081.kpi,172.16.1.81' (RSA) to the list of known hosts. n081 Warning: Permanently added 'n082.kpi,172.16.1.82' (RSA) to the list of known hosts. n082 Warning: Permanently added 'n083.kpi,172.16.1.83' (RSA) to the list of known hosts. n083 Warning: Permanently added 'n084.kpi,172.16.1.84' (RSA) to the list of known hosts. n084 Warning: Permanently added 'n085.kpi,172.16.1.85' (RSA) to the list of known hosts. n085 Warning: Permanently added 'n086.kpi,172.16.1.86' (RSA) to the list of known hosts. n086 Warning: Permanently added 'n087.kpi,172.16.1.87' (RSA) to the list of known hosts. n087 Warning: Permanently added 'n088.kpi,172.16.1.88' (RSA) to the list of known hosts. n088 Warning: Permanently added 'n089.kpi,172.16.1.89' (RSA) to the list of known hosts. n089 Warning: Permanently added 'n090.kpi,172.16.1.90' (RSA) to the list of known hosts. n090 Warning: Permanently added 'n091.kpi,172.16.1.91' (RSA) to the list of known hosts. n091 Warning: Permanently added 'n092.kpi,172.16.1.92' (RSA) to the list of known hosts. n092 Warning: Permanently added 'n093.kpi,172.16.1.93' (RSA) to the list of known hosts. n093 Warning: Permanently added 'n094.kpi,172.16.1.94' (RSA) to the list of known hosts. n094 Warning: Permanently added 'n095.kpi,172.16.1.95' (RSA) to the list of known hosts. n095 Warning: Permanently added 'n096.kpi,172.16.1.96' (RSA) to the list of known hosts. n096 Warning: Permanently added 'n097.kpi,172.16.1.97' (RSA) to the list of known hosts. n097 Warning: Permanently added 'n098.kpi,172.16.1.98' (RSA) to the list of known hosts. n098 Warning: Permanently added 'n099.kpi,172.16.1.99' (RSA) to the list of known hosts. n099 Warning: Permanently added 'n100.kpi,172.16.1.100' (RSA) to the list of known hosts. n100 Warning: Permanently added 'n101.kpi,172.16.1.101' (RSA) to the list of known hosts. n101 Warning: Permanently added 'n102.kpi,172.16.1.102' (RSA) to the list of known hosts. n102 Warning: Permanently added 'n103.kpi,172.16.1.103' (RSA) to the list of known hosts. n103 Warning: Permanently added 'n104.kpi,172.16.1.104' (RSA) to the list of known hosts. n104 Warning: Permanently added 'n105.kpi,172.16.1.105' (RSA) to the list of known hosts. n105 Warning: Permanently added 'n106.kpi,172.16.1.106' (RSA) to the list of known hosts. n106 Warning: Permanently added 'n107.kpi,172.16.1.107' (RSA) to the list of known hosts. n107 Warning: Permanently added 'n108.kpi,172.16.1.108' (RSA) to the list of known hosts. n108 Warning: Permanently added 'n109.kpi,172.16.1.109' (RSA) to the list of known hosts. n109 Warning: Permanently added 'n110.kpi,172.16.1.110' (RSA) to the list of known hosts. n110 Warning: Permanently added 'n111.kpi,172.16.1.111' (RSA) to the list of known hosts. n111 Warning: Permanently added 'n112.kpi,172.16.1.112' (RSA) to the list of known hosts. n112
