came error from nc

Dan Nelson dnelson at allantgroup.com
Mon Oct 31 16:11:02 UTC 2011


In the last episode (Oct 31), Camal said:
> Hi.  My name is Jamal.
> 
> I am from Azerbaijan.
> 
> When I tried open local port with "nc" and send to him
> "/usr/local/bin/bash" came error.
> 
> nc -l 12345 -e /bin/bash 
> , Error        ->
> nc: getaddrinfo: servname not supported for ai_socktype
> 
> in /etc/resolv.conf and /etc/hosts files checked all of was right.
> 
> Why is it so?

I can't reproduce your error message, but your command won't do what you
want anyway.  The nc command that comes with FreeBSD doesn't support the
"listen on a socket and run a command" option.  Its -e is an ipsec option. 
If you install /usr/ports/net/netcat and use that command, it should work:

netcat -l -p 12345 -e /usr/local/bin/bash

-- 
	Dan Nelson
	dnelson at allantgroup.com


More information about the freebsd-questions mailing list