You are not logged in.

#1 2008-05-07 02:49:38

Dr Small
Member
From: Behind a Terminal
Registered: 2008-03-02
Posts: 59
Website

Tor: Could not bind to localhost

I have been attempting to get tor working all evening, even followed the guide at the wiki which didn't seem to help, and I have always ran Tor without privoxy before. Well, for some odd reason, Tor won't bind to localhost:9050 This I have no reason why, and has been bumfuzzling me all evening.

When I start tor (an root) I get:

May 06 22:42:58.240 [notice] Tor v0.1.2.19. This is experimental software. Do not rely on it for strong anonymity.
May 06 22:42:58.245 [notice] Initialized libevent version 1.3e using method epoll. Good.
May 06 22:42:58.249 [notice] Opening Socks listener on localhost:9050
May 06 22:42:58.253 [warn] Could not bind to localhost:9050: Cannot assign requested address
May 06 22:42:58.257 [warn] Failed to parse/validate config: Failed to bind one of the listener ports.
May 06 22:42:58.261 [err] Reading config failed--see warnings above.

In my /etc/tor/torrc file, I have:

SocksPort 9050 # what port to open for local application connections
SocksBindAddress localhost # accept connections only from localhost

I have been trying to play away from privoxy to solve my problem, because I know it is not essential to Tor starting and connecting, so that has nothing to do with it. Instead, it appears as though I can not bind Tor to the specified port on localhost. No... I am not running any other services on 9050 and I do not have any other instances of Tor running.

Any ideas? Because I am running out of them...

Dr Small

Last edited by Dr Small (2008-05-07 02:50:27)

Offline

#2 2008-05-07 03:57:39

tam1138
Member
Registered: 2007-09-10
Posts: 235

Re: Tor: Could not bind to localhost

Is localhost in your /etc/hosts file?  Is something else listening on 9050?  ("netstat -tn | grep 9050")

Offline

#3 2008-05-07 12:21:20

Dr Small
Member
From: Behind a Terminal
Registered: 2008-03-02
Posts: 59
Website

Re: Tor: Could not bind to localhost

My hosts file says:

127.0.0.1        localhost.localdomain    localhost

And netstat shows nothing listening on port 9050 :S

Offline

#4 2008-05-07 19:58:47

tam1138
Member
Registered: 2007-09-10
Posts: 235

Re: Tor: Could not bind to localhost

At this point, I'd grovel through the Tor startup scripts to find how it's invoked from the command-line and strace it to see exactly where and how it's failing.

Offline

#5 2008-05-08 01:59:42

Dr Small
Member
From: Behind a Terminal
Registered: 2008-03-02
Posts: 59
Website

Re: Tor: Could not bind to localhost

I upgraded the system so I could get the nvidia driver working and get the 2.6.24 kernel, and just thought I would try Tor.... And it now works! So, problem solved smile

Dr Small

Offline

#6 2012-02-12 11:59:06

cmthornton
Member
Registered: 2012-02-12
Posts: 1

Re: Tor: Could not bind to localhost

[NOTE: I realize I am bumping an old thread, but this post is the first result in Google, Bing, Yahoo, and DuckDuckGo, and it does not have a solution.]

As tam1138 said previously, If `/etc/hosts' contains the line:

127.0.0.1 localhost.localdomain localhost

and no other programs are using port 9050. (Check this by doing the following:)

netstat -nt | grep 9050

and

strace /usr/sbin/tor

shows that the `bind()' system call fails, then make sure your loopback interface is up by:

ifconfig lo | grep UP >/dev/null && echo 'loopback interface is up' || echo 'loopback interface is down'

If the interface is not up, you can manually bring it up by:

ifup lo

or

/etc/rc.d/network restart # this restarts ALL network devices, hopefully including lo

(My appologies if the above path is incorrect, I use Debian, and I did a quick search to try to find where Arch's rc scripts are located.)

If the lo interface does not come up,  it may be misconfigured. Make sure your `/etc/rc.conf' contains a line such as:

INTERFACES=(lo eth0) # and any other interfaces you may have

(Again, my apologies if this is wrong, try searching the web or https://wiki.archlinux.org/index.php/Rc.conf or https://wiki.archlinux.org/index.php/Netcfg to see how to properly configure your device)

If your lo interface is up, and you still can't bind to localhost:9050 then start looking at Tor's startup scripts.

Offline

#7 2012-02-12 12:49:36

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,271

Re: Tor: Could not bind to localhost

Read this: https://wiki.archlinux.org/index.php/Be … tc.2Fhosts

"Errors in this entry may cause poor network performance and/or certain programs to open very slowly, or not work at all. This is a very common error for beginners."


This is wrong:

127.0.0.1  localhost.localdomain  localhost

This is right:

127.0.0.1  localhost.localdomain  localhost YOURHOSTNAME

Thread is a very old thread indeed. I'm glad you realise it! A lot of shit has changed since 2008, May.

Last edited by DSpider (2012-02-12 12:51:56)


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

Board footer

Powered by FluxBB