SSH error cannot Forward or Listen "bind: Cannot assign requested address"

debug1: Local connections to LOCALHOST:18006 forwarded to remote address 192.168.1.93:8006
debug1: Local forwarding listening on 127.0.0.1 port 18006.
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on ::1 port 18006.
bind: Cannot assign requested address

What we are seeing is that we can't listen on an IPV6 address of ::1.  We need to tell SSH to stop using IPV6 so we'll edit ssh_config to take care of this issue. 

Solution:


sudo vi /etc/ssh/ssh_config

 

Set this:


Host *
AddressFamily inet

 

Formerly the "inet" would say any which means it would be IPV6 too but we can't have that since it breaks out forwarding!

The "inet" in address family disables IPV6 because we can see in the SSH verbose output earlier that it was trying to listen on ::1 (which is an IPV6 address).  This breaks if you don't have IPV6 enabled in your OS which is why we get the message from bind.


Tags:

ssh, bind, assign, requested, debug, connections, localhost, forwarded, forwarding, listener, ipv, ll, edit, ssh_config, sudo, vi, etc, addressfamily, inet, formerly, quot, disables, verbose, output, enabled, os,

Latest Articles

  • Linux Ubuntu Cannot Print Large Images
  • Cannot Print PDF Solution and Howto Resize
  • Linux Console Login Screen TTY Change Message
  • Apache Cannot Start Listening Already on 0.0.0.0
  • MySQL Bash Query to pipe input directly without using heredoc trick
  • CentOS 6 and 7 / RHEL Persistent DHCP Solution
  • Debian Ubuntu Mint rc-local service startup error solution rc-local.service: Failed at step EXEC spawning /etc/rc.local: Exec format error
  • MySQL Cheatsheet Guide and Tutorial
  • bash script kill whois or other command that is running for too long
  • Linux tftp listens on all interfaces and IPs by DEFAULT Security Risk Hole Solution
  • python import docx error
  • Cisco Unified Communications Manager Express Cheatsheet CUCME CME
  • Linux Ubuntu Debian Missing privilege separation directory: /var/run/sshd
  • bash how to count the number of columns or words in a line
  • bash if statement how to test program output without assigning to variable
  • RTNETLINK answers: Network is unreachable
  • Centos 7 how to save iptables rules like Centos 6
  • nfs tuning maximum amount of connections
  • qemu-kvm error "Could not initialize SDL(No available video device) - exiting"
  • Centos 7 tftpd will not work with selinux enabled