バージョン間のデフォルトのsshd_config変更の違いはどこで確認できますか?

バージョン間のデフォルトのsshd_config変更の違いはどこで確認できますか?

バージョンapt-get upgradeから。 openssh-server1:8.2p1-4ubuntu0.41:8.2p1-4ubuntu0.5

アップデート中に表示される

A new version (/tmp/filehQFzF3) of configuration file /etc/ssh/sshd_config is available, but the version installed currently has been locally modified. 

変更はcloud-initスクリプトの一部であるため、そのスクリプトで更新する必要があることを確認したいと思います。これにはsshd_config元のファイルの違いが必要です。1:8.2p1-4ubuntu0.41:8.2p1-4ubuntu0.5

変更履歴:https://launchpad.net/ubuntu/+source/openssh/1:8.2p1-4ubuntu0.5ただし、設定ファイルは変更されていないようです。今私は混乱しました。

対話型アップグレードの差分出力は次のとおりです。

Line by line differences between versions                                      
│ --- /etc/ssh/sshd_config root.root 0644 2022-01-30 22:45:30                    
│ +++ /tmp/filehQFzF3 root.root 0644 2022-05-26 19:43:13                         
│ @@ -31,15 +31,15 @@                                                            
│  # Authentication:                                                             
│  #LoginGraceTime 2m                                                            
│ -PermitRootLogin no                                                            
│ +#PermitRootLogin prohibit-password                                            
│  #StrictModes yes                                                              
│ -MaxAuthTries 2                                                                
│ +#MaxAuthTries 6                                                               
│  #MaxSessions 10                                                               
│  #PubkeyAuthentication yes                                                     
│  # Expect .ssh/authorized_keys2 to be disregarded by default in future.        
│ -AuthorizedKeysFile .ssh/authorized_keys                                       
│ +#AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2                
│  #AuthorizedPrincipalsFile none                                                
│ @@ -55,7 +55,7 @@                                                              
│  #IgnoreRhosts yes                                                             
│  # To disable tunneled clear text passwords, change to no here!                
│ -#PasswordAuthentication yes                                                   
│ +PasswordAuthentication no                                                     
│  #PermitEmptyPasswords no                                                      
│  # Change to yes to enable challenge-response passwords (beware issues with    
│ @@ -85,10 +85,10 @@                                                            
│  # and ChallengeResponseAuthentication to 'no'.                                
│  UsePAM yes                                                                    
│ -AllowAgentForwarding no                                                       
│ -AllowTcpForwarding no                                                         
│ +#AllowAgentForwarding yes                                                     
│ +#AllowTcpForwarding yes                                                       
│  #GatewayPorts no                                                              
│ -X11Forwarding no                                                              
│ +X11Forwarding yes                                                             
│  #X11DisplayOffset 10                                                          
│  #X11UseLocalhost yes                                                          
│  #PermitTTY yes                                                                
│ @@ -121,5 +121,3 @@                                                            
│  # AllowTcpForwarding no                                                       
│  # PermitTTY no                                                                
│  # ForceCommand cvs server                                                     
│ -PasswordAuthentication no                  

cloud-initこれは sshd を構成するスクリプトの一部です。

  - sed -i -e '/^PermitRootLogin/s/^.*$/PermitRootLogin no/' /etc/ssh/sshd_config
  - sed -i -e '/^PasswordAuthentication/s/^.*$/PasswordAuthentication no/' /etc/ssh/sshd_config
  - sed -i -e '/^X11Forwarding/s/^.*$/X11Forwarding no/' /etc/ssh/sshd_config
  - sed -i -e '/^#MaxAuthTries/s/^.*$/MaxAuthTries 2/' /etc/ssh/sshd_config
  - sed -i -e '/^#AllowTcpForwarding/s/^.*$/AllowTcpForwarding no/' /etc/ssh/sshd_config
  - sed -i -e '/^#AllowAgentForwarding/s/^.*$/AllowAgentForwarding no/' /etc/ssh/sshd_config
  - sed -i -e '/^#AuthorizedKeysFile/s/^.*$/AuthorizedKeysFile .ssh\/authorized_keys/' /etc/ssh/sshd_config

今私の質問は、このsedコマンドが新しいバージョンでも私たちが望むことをするかどうかです。これを理解するには、cloud-initこのスクリプトを使用して新しいインスタンスを作成するときに新しい基本構成がどのように表示されるかを理解する必要があります。

ベストアンサー1

おすすめ記事