SSH-2 私鑰認(rèn)證 基于客戶端
//先創(chuàng)建公鑰和私鑰
ssh-keygen
按3個(gè)回車(chē) 生成公鑰和私鑰
4920D492-98B8-4510-9871-25268415614D.png
2.將私鑰追加到服務(wù)器的授權(quán)文件證書(shū)尾部
cd ~/.ssh 進(jìn)入文件夾
ls -l
ssh-copy-id root@192.168.9.46 講私鑰追加到服務(wù)器的授權(quán)證書(shū)尾部
的尾部
3.exit 后在進(jìn)入
image.png
你會(huì)發(fā)現(xiàn)不需要密碼 但是moblie用戶登錄還是需要密碼的
4.檢測(cè)是否追加在服務(wù)器認(rèn)證尾部
~/.ssh/authorized_keys
image.png