服务器见密钥认证

ssh [email protected]          
1, ssh-keygen -t rsa        
   # scp  /home/tomcat/.ssh/id_rsa.pub  [email protected]:/home/jcs/.ssh/id_rsa.pub         
2,             #  touch /home/jcs/.ssh/authorized_keys (該当ファイルが存在した場合、本ステップをスキップする)        
              # cat /home/jcs/.ssh/id_rsa.pub  >> /home/jcs/.ssh/authorized_keys (id_rsa.pubの内容をauthorized_keysに追加する)        
              # chmod 600  /home/jcs/.ssh/authorized_keys        
              # chmod 700  /home/jcs/.ssh        
           
3, [tomcat@localhost .ssh]#ssh-agent bash        
  [tomcat@localhost .ssh]#ssh-add  /home/tomcat/.ssh/id_rsa        

你可能感兴趣的:(服务器)