Re-order SSH key types to make ed25519 default
- Fixes: #981 Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
@@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||||||
- Don't mount /run during wwinit. #1566
|
- Don't mount /run during wwinit. #1566
|
||||||
- Simpler permissions in official RPM packages. #1696
|
- Simpler permissions in official RPM packages. #1696
|
||||||
- Create temporary files in overlay directory during `wwctl overlay edit`. #1473
|
- Create temporary files in overlay directory during `wwctl overlay edit`. #1473
|
||||||
|
- Re-order SSH key types to make ed25519 default. #981
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ image mounts:
|
|||||||
readonly: true
|
readonly: true
|
||||||
ssh:
|
ssh:
|
||||||
key types:
|
key types:
|
||||||
|
- ed25519
|
||||||
|
- ecdsa
|
||||||
- rsa
|
- rsa
|
||||||
- dsa
|
- dsa
|
||||||
- ecdsa
|
|
||||||
- ed25519
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
type SSHConf struct {
|
type SSHConf struct {
|
||||||
KeyTypes []string `yaml:"key types,omitempty" default:"[\"rsa\",\"dsa\",\"ecdsa\",\"ed25519\"]"`
|
KeyTypes []string `yaml:"key types,omitempty" default:"[\"ed25519\",\"ecdsa\",\"rsa\",\"dsa\"]"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
|
|
||||||
warewulfconf "github.com/warewulf/warewulf/internal/pkg/config"
|
warewulfconf "github.com/warewulf/warewulf/internal/pkg/config"
|
||||||
|
"github.com/warewulf/warewulf/internal/pkg/overlay"
|
||||||
"github.com/warewulf/warewulf/internal/pkg/util"
|
"github.com/warewulf/warewulf/internal/pkg/util"
|
||||||
"github.com/warewulf/warewulf/internal/pkg/wwlog"
|
"github.com/warewulf/warewulf/internal/pkg/wwlog"
|
||||||
)
|
)
|
||||||
@@ -18,6 +19,15 @@ func SSH(keyTypes ...string) error {
|
|||||||
if os.Getuid() == 0 {
|
if os.Getuid() == 0 {
|
||||||
fmt.Printf("Updating system keys\n")
|
fmt.Printf("Updating system keys\n")
|
||||||
conf := warewulfconf.Get()
|
conf := warewulfconf.Get()
|
||||||
|
|
||||||
|
if conf.Warewulf.EnableHostOverlay() {
|
||||||
|
if err := overlay.BuildHostOverlay(); err != nil {
|
||||||
|
wwlog.Warn("host overlay could not be built: %s", err)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
wwlog.Info("host overlays are disabled")
|
||||||
|
}
|
||||||
|
|
||||||
wwkeydir := path.Join(conf.Paths.Sysconfdir, "warewulf/keys") + "/"
|
wwkeydir := path.Join(conf.Paths.Sysconfdir, "warewulf/keys") + "/"
|
||||||
|
|
||||||
err := os.MkdirAll(path.Join(conf.Paths.Sysconfdir, "warewulf/keys"), 0755)
|
err := os.MkdirAll(path.Join(conf.Paths.Sysconfdir, "warewulf/keys"), 0755)
|
||||||
|
|||||||
@@ -109,11 +109,11 @@ data from other structures.
|
|||||||
|
|
||||||
### SSH
|
### SSH
|
||||||
- Key types:
|
- Key types:
|
||||||
|
- ed25519
|
||||||
|
- ecdsa
|
||||||
- rsa
|
- rsa
|
||||||
- dsa
|
- dsa
|
||||||
- ecdsa
|
- First key type: ed25519
|
||||||
- ed25519
|
|
||||||
- First key type: rsa
|
|
||||||
|
|
||||||
## Node
|
## Node
|
||||||
|
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ Filename: etc/profile.d/ssh_setup.csh
|
|||||||
if ( ( $_UID > 500 || $_UID == 0 ) && ( ! -f "$HOME/.ssh/config" && ! -f "$HOME/.ssh/cluster" ) ) then
|
if ( ( $_UID > 500 || $_UID == 0 ) && ( ! -f "$HOME/.ssh/config" && ! -f "$HOME/.ssh/cluster" ) ) then
|
||||||
echo "Configuring SSH for cluster access"
|
echo "Configuring SSH for cluster access"
|
||||||
install -d -m 700 $HOME/.ssh
|
install -d -m 700 $HOME/.ssh
|
||||||
ssh-keygen -t rsa -f $HOME/.ssh/cluster -N '' -C "Warewulf Cluster key" >& /dev/null
|
ssh-keygen -t ed25519 -f $HOME/.ssh/cluster -N '' -C "Warewulf Cluster key" >& /dev/null
|
||||||
cat $HOME/.ssh/cluster.pub >>! $HOME/.ssh/authorized_keys
|
cat $HOME/.ssh/cluster.pub >>! $HOME/.ssh/authorized_keys
|
||||||
chmod 0600 $HOME/.ssh/authorized_keys
|
chmod 0600 $HOME/.ssh/authorized_keys
|
||||||
|
|
||||||
@@ -347,7 +347,7 @@ Filename: etc/profile.d/ssh_setup.sh
|
|||||||
if [ $_UID -ge 500 -o $_UID -eq 0 ] && [ ! -f "$HOME/.ssh/config" -a ! -f "$HOME/.ssh/cluster" ]; then
|
if [ $_UID -ge 500 -o $_UID -eq 0 ] && [ ! -f "$HOME/.ssh/config" -a ! -f "$HOME/.ssh/cluster" ]; then
|
||||||
echo "Configuring SSH for cluster access"
|
echo "Configuring SSH for cluster access"
|
||||||
install -d -m 700 $HOME/.ssh
|
install -d -m 700 $HOME/.ssh
|
||||||
ssh-keygen -t rsa -f $HOME/.ssh/cluster -N '' -C "Warewulf Cluster key" > /dev/null 2>&1
|
ssh-keygen -t ed25519 -f $HOME/.ssh/cluster -N '' -C "Warewulf Cluster key" > /dev/null 2>&1
|
||||||
cat $HOME/.ssh/cluster.pub >> $HOME/.ssh/authorized_keys
|
cat $HOME/.ssh/cluster.pub >> $HOME/.ssh/authorized_keys
|
||||||
chmod 0600 $HOME/.ssh/authorized_keys
|
chmod 0600 $HOME/.ssh/authorized_keys
|
||||||
|
|
||||||
|
|||||||
@@ -46,10 +46,10 @@ Warewulf (4.6.0):
|
|||||||
readonly: true
|
readonly: true
|
||||||
ssh:
|
ssh:
|
||||||
key types:
|
key types:
|
||||||
|
- ed25519
|
||||||
|
- ecdsa
|
||||||
- rsa
|
- rsa
|
||||||
- dsa
|
- dsa
|
||||||
- ecdsa
|
|
||||||
- ed25519
|
|
||||||
wwclient:
|
wwclient:
|
||||||
port: 0
|
port: 0
|
||||||
|
|
||||||
@@ -165,10 +165,10 @@ SSH key types to generate during ``wwctl configure ssh`` may be overridden using
|
|||||||
|
|
||||||
ssh:
|
ssh:
|
||||||
key types:
|
key types:
|
||||||
|
- ed25519
|
||||||
|
- ecdsa
|
||||||
- rsa
|
- rsa
|
||||||
- dsa
|
- dsa
|
||||||
- ecdsa
|
|
||||||
- ed25519
|
|
||||||
|
|
||||||
Warewulf will generate host keys for each listed key type.
|
Warewulf will generate host keys for each listed key type.
|
||||||
The first listed key type is used to generate authentication ssh keys.
|
The first listed key type is used to generate authentication ssh keys.
|
||||||
|
|||||||
Reference in New Issue
Block a user