Skip to content

sshd not listening for ipv6 address #7668

Closed
@vikneels

Description

@vikneels

Description

ssh of ipv6 address does not work though ping works. The failure is noticed as part of https://github.com/Azure/sonic-mgmt/blob/master/spytest/tests/system/test_ssh.py where we try to do a ssh on ipv6 address

When I checked the sshd config, by default listen is disabled for ipv6 address and the moment I uncommented the same and restarted sshd service, ssh to ipv6 works.

#Port 22
#AddressFamily any
ListenAddress 0.0.0.0
#ListenAddress :: ===> commented

Seems like the config is mentioned as part of build_debian.sh in sonic-buildimage

Configure sshd to listen for v4 connections; disable listening for v6 connections

sudo sed -i 's/^ListenAddress ::/#ListenAddress ::/' $FILESYSTEM_ROOT/etc/ssh/sshd_config
sudo sed -i 's/^#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/' $FILESYSTEM_ROOT/etc/ssh/sshd_config

Not sure if why sshd listening on v6 connections is disabled. Do we got to turn it on?

Steps to reproduce the issue:

  1. run https://github.com/Azure/sonic-mgmt/blob/master/spytest/tests/system/test_ssh.py

Describe the results you received:

2021-05-20 20:34:00,609 T0000: INFO [D2-SD2] FCMD: sshpass -p 'cisco123' ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=30 cisco@1001::1 show vlan config
2021-05-20 20:34:00,663 T0000: INFO [D2-SD2] ssh: connect to host 1001::1 port 22: Connection refused
2021-05-20 20:34:00,665 T0000: INFO [D2-SD2] cisco@sonic:~$

Describe the results you expected:

ssh should work ipv6 address

Output of show version:

Seen on latest of master & 202012

(paste your output here)

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions