# socket: Address family not supported by protocol [Solved]

## vinodramu

We are trying to install qmail on gentoo linux. We followed the instructions at 

http://www.gentoo.org/doc/en/qmail-howto.xml

We were able to follow the instructions till "Code Listing 2.5: Test delivery service" section. As per this section, when we give the ssh command, we get an error message as shown below. 

```

tux service # ssh vinodram@localhost

socket: Address family not supported by protocol

ssh: connect to host localhost port 22: Address family not supported by protocol
```

I searched the other threads in this forum and found suggestions to check if the kernel is configure to support "Packet socket: mmapped IO". I have this configured. Also they suggested to check if "The IPv6 protocol" is also supported. I don't think I should have IPV6 support enabled. 

Could any one please help me to resolve this issue?

Thank you,

VinodRamuLast edited by vinodramu on Thu Jan 11, 2007 7:27 am; edited 1 time in total

----------

## didymos

Try looking in the ssh config files for this:

```

AddressFamily any

```

then change "any" to "inet".  This should make it use IPV4 exclusively.

----------

## lagalopex

Do have a sshd running on port 22? ("netstat -tulpen")

"ssh -vv vinodram@localhost" might help to trace... you dont use ipv6... so do you have a ipv6 in your "/etc/hosts"?

----------

## vinodramu

didymos:

I am a newbie and I am not aware which configuration file I need to do your suggested changes. Could you please let me know the path of the configuration file?

lagalopex:

I tried your suggestion and looks like I don't have the port open. Here is the output:

```
tux X11 # netstat -tulpen

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      PID/Program name

tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      60         9910       5324/mysqld

udp        0      0 0.0.0.0:68              0.0.0.0:*                           0          9628       5163/dhcpcd

tux X11 # ssh -vv vinodram@localhost

OpenSSH_4.3p2, OpenSSL 0.9.7j 04 May 2006

debug1: Reading configuration data /etc/ssh/ssh_config

debug2: ssh_connect: needpriv 0

debug1: Connecting to localhost [::1] port 22.

socket: Address family not supported by protocol

ssh: connect to host localhost port 22: Address family not supported by protocol

```

----------

## lagalopex

Yes... you need to start sshd by "/etc/init.d/sshd start".

And the "/etc/hosts" normaly has the following entries:

```
127.0.0.1       localhost

::1             localhost
```

Comment the last one, as its a ipv6 address!

----------

## vinodramu

lagalopex:

Thanks that solved my problem. I was able to run the 

```
ssh vinodram@localhost 
```

command and issue the following commands

```
vinodram@tux ~ $ qmail-inject postmaster << EOF

> test postmaster e-mail!

> EOF

tux vinodram # mutt

bash: mutt: command not found

```

As you can see above when I tried to run the mutt command, as per the documentation it throws an error. I have no clue what does that mean. Could you please help me?

Thank you,

VinodRamu

----------

## lagalopex

mutt is a text-based mail client. You should just start the mail client you configured to see if you can fetch your sent mails...

----------

## newtonian

You should probably run the code below once so that sshd is started automaticly at boot:

```
rc-update add sshd default
```

Cheers,

----------

