|  Linux 
            Tips | 
        
         
            | 
           
             sshでパスワード認証を禁止するには 
            北浦訓行 
              2003/4/10 
           | 
        
      
       鍵交換方式のsshでアクセスするにはによって、公開鍵方式によるsshアクセスができるようになったら、セキュリティを高めるためにパスワード認証によるsshアクセスは禁止した方がいい。この設定は、/etc/ssh/sshd_configで行う。
      
 テキストエディタで/etc/ssh/sshd_configを開いたら、以下の行を変更する。
      
         
          #PasswordAuthentication yes | 
        
         
          |        ↓ | 
        
         
          PasswordAuthentication no | 
        
      
       念のため、以下の設定も行っておこう。
      
         
          #RSAAuthentication yes | 
        
         
          |        ↓ | 
        
         
          RSAAuthentication yes ←RSA認証を許可(ssh1のみ) | 
        
      
      
      
         
          #PubkeyAuthentication yes | 
        
         
          |        ↓ | 
        
         
          PubkeyAuthentication yes ←公開鍵認証を許可(ssh2のみ) | 
        
      
      
      
         
          #RhostsAuthentication no | 
        
         
          |        ↓ | 
        
         
          RhostsAuthentication no ←rhost認証を禁止 | 
        
      
       変更が終わったら、以下のようにsshdを再起動する。
      
         
          # service sshd restart 
            sshdを停止中:                                              [  OK  ] 
            sshdを起動中:                                              [  OK  ] | 
        
      
       以上で、設定は終了だ。パスワード認証方式のsshでログインを試みて、切断されれば設定は成功だ。
      
      
|  Linux Squareフォーラム Linux Tipsカテゴリ別インデックス | 
 
	
		Linux & OSS 記事ランキング
		
		
			本日
			月間