Skip to content

Commit

Permalink
fix(iosxe): allow deprecated ssh-rsa algorithm (fixes #498)
Browse files Browse the repository at this point in the history
  • Loading branch information
bl4ko committed Feb 21, 2025
1 parent 34eb2f5 commit bb1dc65
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@ RUN addgroup -S -g 10001 netbox && \
chown -R netbox:netbox /app
USER netbox:netbox

# Also allow deprecated ssh algorithims for older devices
# See https://github.com/SRC-doo/netbox-ssot/issues/498
RUN mkdir -p /home/netbox/.ssh/ && \
cat <<EOF > /home/netbox/.ssh/config
Host *
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
EOF

WORKDIR /app

COPY --from=builder --chown=netbox:netbox /app/cmd/netbox-ssot/main ./main
Expand Down
4 changes: 3 additions & 1 deletion internal/source/ios-xe/iosxe.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ func (is *IOSXESource) Init() error {
options.WithAuthUsername(is.SourceConfig.Username),
options.WithAuthPassword(is.SourceConfig.Password),
options.WithPort(is.SourceConfig.Port),
options.WithAuthNoStrictKey(), // inside container we can't confirm ssh key
options.WithAuthNoStrictKey(),
// See https://github.com/SRC-doo/netbox-ssot/issues/498
options.WithSSHConfigFile("~/.ssh/config"),
)
if err != nil {
return fmt.Errorf("failed to create driver: %s", err)
Expand Down

0 comments on commit bb1dc65

Please sign in to comment.