You are not logged in.

#1 2010-11-09 22:15:25

iamsmrt
Member
Registered: 2009-08-12
Posts: 138

Trouble with SSH tunneling (and mpd)

I'm trying to control my remote mpd server via ssh with the command:

ssh -Nf -L6600:localhost:6600 user@example.org

Now when I try running mpd I get:

brian@brian-netbook:~/.mpd$ mpd config
listen: Failed to listen on *:6600: Address already in use
Aborted

Checking the ports with netstat:

brian@brian-netbook:~/.mpd$ netstat -anlp | grep 6600
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:6600          0.0.0.0:*               LISTEN      26737/ssh           
tcp        0      0 ::1:6600                :::*                    LISTEN      26737/ssh 

My mpd config is pretty much the default except pointing at my music directories (http://pastebin.com/LyjbC98E). Any idea what I'm doing wrong?

Offline

#2 2010-11-09 22:26:04

Stebalien
Member
Registered: 2010-04-27
Posts: 1,237
Website

Re: Trouble with SSH tunneling (and mpd)

Shouldn't you be running mpd on your remote server? According to those code blocks, you are setting up an ssh tunnel to a remote server and then running mpd on your local computer.


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#3 2010-11-09 22:41:38

kittykatt
Member
From: Missouri, USA
Registered: 2009-11-04
Posts: 260
Website

Re: Trouble with SSH tunneling (and mpd)

You're trying to bind two applications to the same port. Won't work.

What I do (and this may not be useful for you since I run my MPD server behind a router that I control) is set my $MPD_HOST and $MPD_PORT to the IP/hostname/somethingthatresolvestoserver and port that MPD is bound to on the server (6600 by default). This is of course using the HTTP output plugin via port 8000. Then, I just open up port 6600 and 8000 on my router's firewall and voila! I can has MPD control and stream remotely.

I then use mpc in the console/terminal to control the remote MPD instance. It reads the enviroment variables $MPD_HOST and $MPD_PORT, which I exported earlier in my .bashrc, to know the host and port of the MPD instance it should be controlling.

Last edited by kittykatt (2010-11-09 22:43:19)


- [ My Blog ] | [ AUR Packages ] | [ My deviantART ] | [ screenFetch ] | [ SilverIRC ] -

Offline

#4 2010-11-09 22:47:42

iamsmrt
Member
Registered: 2009-08-12
Posts: 138

Re: Trouble with SSH tunneling (and mpd)

Stebalien wrote:

Shouldn't you be running mpd on your remote server? According to those code blocks, you are setting up an ssh tunnel to a remote server and then running mpd on your local computer.

Color me stupid. Thanks.

kittykatt wrote:

You're trying to bind two applications to the same port. Won't work.

What I do (and this may not be useful for you since I run my MPD server behind a router that I control) is set my $MPD_HOST and $MPD_PORT to the IP/hostname/somethingthatresolvestoserver and port that MPD is bound to on the server (6600 by default). This is of course using the HTTP output plugin via port 8000. Then, I just open up port 6600 and 8000 on my router's firewall and voila! I can has MPD control and stream remotely.

I then use mpc in the console/terminal to control the remote MPD instance. It reads the enviroment variables $MPD_HOST and $MPD_PORT, which I exported earlier in my .bashrc, to know the host and port of the MPD instance it should be controlling.

Yea, that's what I think I'll be doing since I heard http is faster than icecast.

Offline

Board footer

Powered by FluxBB