[24073] 2015-07-09_SSH使用密钥登录并禁止口令登录实践

文档创建者:s7ckTeam
浏览次数:25
最后更新:2025-01-18
2015-07-09_SSH使用密钥登录并禁止口令登录实践 S S H   使 L i n u x   2 0 1 5 - 0 7 - 0 9 V P S 访 2 2 S S H 2 2 S S H 使 P u b l i c K e y p a s s p h r a s e L i n u x L i n u x s s h - k e y g e n   - t   r s a [   ( i d _ r s a )     ( i d _ r s a . p u b ) ] W i n d o w s S e c u r C R T / X s h e l l / P u T T Y [ S S H - 2   R S A   2 0 4 8 ] 3 .   1 .   # S S H 2 .   s s h - k e y g e n   - t   r s a 4 .   G e n e r a t i n g   p u b l i c / p r i v a t e   r s a   k e y   p a i r . 5 .   # 使 6 .   E n t e r   f i l e   i n   w h i c h   t o   s a v e   t h e   k e y   ( / r o o t / . s s h / i d _ r s a ) :  
a u t h o r i z e d _ k e y s 4 .   S S H 3 .   1 1 .   7 .   # 8 .   E n t e r   p a s s p h r a s e   ( e m p t y   f o r   n o   p a s s p h r a s e ) :   9 .   # 1 0 .   E n t e r   s a m e   p a s s p h r a s e   a g a i n :   1 1 .   Y o u r   i d e n t i f i c a t i o n   h a s   b e e n   s a v e d   i n   / r o o t / . s s h / i d _ r s a . 1 2 .   Y o u r   p u b l i c   k e y   h a s   b e e n   s a v e d   i n   / r o o t / . s s h / i d _ r s a . p u b . 1 3 .   T h e   k e y   f i n g e r p r i n t   i s : 1 4 .   a a : 8 b : 6 1 : 1 3 : 3 8 : a d : b 5 : 4 9 : c a : 5 1 : 4 5 : b 9 : 7 7 : e 1 : 9 7 : e 1   r o o t @ l o c a l h o s t . l o c a l d o m a i n 1 5 .   T h e   k e y ' s   r a n d o m a r t   i m a g e   i s : 1 6 .   + - - [   R S A   2 0 4 8 ] - - - - + 1 7 .   |         . o .                     | 1 8 .   |         . .       .   .           | 1 9 .   |       .     .   .   o   o         | 2 0 .   |   o .     .   .   o   E           | 2 1 .   | o . =       .   S   .             | 2 2 .   | . * . +       .                   | 2 3 .   | o . *       .                     | 2 4 .   |   .   +   .                       | 2 5 .   |     .   o .                       | 2 6 .   + - - - - - - - - - - - - - - - - - + 1 .   # , 2 2 使 2 .   # s s h - c o p y - i d   - i   ~ / . s s h / i d _ r s a . p u b   " - p   1 0 0 2 2   u s e r @ s e r v e r " 3 .   s s h - c o p y - i d   - i   ~ / . s s h / i d _ r s a . p u b   r o o t @ 1 9 2 . 1 6 8 . 1 5 . 2 4 1 1 .   # s s h d _ c o n f i g 2 .   v i   / e t c / s s h / s s h d _ c o n f i g 4 .   # 5 .   P a s s w o r d A u t h e n t i c a t i o n   n o 6 .   # 7 .   R S A A u t h e n t i c a t i o n   y e s 8 .   P u b k e y A u t h e n t i c a t i o n   y e s 9 .   # 1 0 .   A u t h o r s i z e d K e y s F i l e   . s s h / a u t h o r i z e d _ k e y s
S S H = =   便 2 .   S S H   -   h t t p : / / w w w . r u a n y i f e n g . c o m / b l o g / 2 0 1 1 / 1 2 / s s h _ r e m o t e _ l o g i n . h t m l 使   S S H   -   h t t p s : / / w w w . l i n o d e . c o m / d o c s / n e t w o r k i n g / s s h / u s e - p u b l i c - k e y - a u t h e n t i c a t i o n - w i t h - s s h 1 .   # R H E L / C e n t O S 2 .   s e r v i c e   s s h d   r e s t a r t 3 .   # u b u n t u 4 .   s e r v i c e   s s h   r e s t a r t 5 .   # d e b i a n 6 .   / e t c / i n i t . d / s s h   r e s t a r t 1 .   e c h o   ' s s h - r s a   X X X X '   > > / r o o t / . s s h / a u t h o r i z e d _ k e y s 3 .   #   4 .   c a t   / r o o t / . s s h / a u t h o r i z e d _ k e y s

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则