Skip to content

Commit 484966e

Browse files
committed
Drop ssh public key handling from SRLinux nodes
1 parent 3065a43 commit 484966e

File tree

5 files changed

+0
-94
lines changed

5 files changed

+0
-94
lines changed

nodes/srl/srl.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"github.com/hairyhenderson/gomplate/v3/data"
2323
"github.com/pkg/errors"
2424
log "github.com/sirupsen/logrus"
25-
"golang.org/x/crypto/ssh"
2625

2726
"github.com/srl-labs/containerlab/cert"
2827
"github.com/srl-labs/containerlab/clab/exec"
@@ -132,8 +131,6 @@ type srl struct {
132131
// to generate certificates
133132
cert *cert.Cert
134133
topologyName string
135-
// SSH public keys extracted from the clab host
136-
sshPubKeys []ssh.PublicKey
137134
// software version SR Linux node runs
138135
swVersion *SrlVersion
139136
}
@@ -235,9 +232,6 @@ func (s *srl) PreDeploy(_ context.Context, params *nodes.PreDeployParams) error
235232
}
236233
}
237234

238-
// store provided pubkeys
239-
s.sshPubKeys = params.SSHPubKeys
240-
241235
// store the certificate-related parameters
242236
// for cert generation to happen in Post-Deploy phase with mgmt IPs as SANs
243237
s.cert = params.Cert
@@ -516,7 +510,6 @@ type srlTemplateData struct {
516510
TLSAnchor string
517511
Banner string
518512
IFaces map[string]tplIFace
519-
SSHPubKeys string
520513
MgmtMTU int
521514
MgmtIPMTU int
522515
DNSServers []string

nodes/srl/srl_default_config.go.tpl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ set / interface ethernet-{{ $ep.Slot }}/{{ $ep.Port }}/{{ $ep.BreakoutNo }} admi
5656
{{- end }}
5757

5858
{{ end -}}
59-
{{- if .SSHPubKeys }}
60-
set / system aaa authentication linuxadmin-user ssh-key [ {{ .SSHPubKeys }} ]
61-
set / system aaa authentication admin-user ssh-key [ {{ .SSHPubKeys }} ]
62-
{{- end }}
6359
set / system banner login-banner "{{ .Banner }}"
6460

6561
{{- if .EnableCustomPrompt }}

nodes/srl/sshkey.go

Lines changed: 0 additions & 32 deletions
This file was deleted.

nodes/srl/sshkey_test.go

Lines changed: 0 additions & 45 deletions
This file was deleted.

nodes/srl/version.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,6 @@ func (n *srl) setVersionSpecificParams(tplData *srlTemplateData) {
160160
// v is in the vMajor.Minor format
161161
v := n.swVersion.MajorMinorSemverString()
162162

163-
// in srlinux >= v23.10+ linuxadmin and admin user ssh keys can only be configured via the cli
164-
// so we add the keys to the template data for rendering.
165-
if len(n.sshPubKeys) > 0 && (semver.Compare(v, "v23.10") >= 0 || n.swVersion.Major == "0") {
166-
tplData.SSHPubKeys = catenateKeys(n.sshPubKeys)
167-
}
168-
169163
// in srlinux >= v24.3+ we add ACL rules to enable http and telnet access
170164
// that are useful for labs and were removed as a security hardening measure.
171165
if semver.Compare(v, "v24.3") >= 0 || n.swVersion.Major == "0" {

0 commit comments

Comments
 (0)