Disable port 6600 from the "outside"
Disable port 6600 from the "outside"
it is possible to disable access to port 6600 from the network. So that it can only be accessed from the host itself? I already have a localhost in /etc/mpd.conf at address. But that doesn't work
Best regards,
Colin
Best regards,
Colin
Re: Disable port 6600 from the "outside"
Hi Max,
Sorry, I still doesn’t see it. I’m also not very good on linux. I have on my /etc/mpd.conf on a raspberry the setting below. Normal (windows) if you bind to local host this means IP 127.0.0.1 and ::1 And that is what I have on the config below. But it is still listen to all IP addresses. Or does this works different on linux
Sorry, I still doesn’t see it. I’m also not very good on linux. I have on my /etc/mpd.conf on a raspberry the setting below. Normal (windows) if you bind to local host this means IP 127.0.0.1 and ::1 And that is what I have on the config below. But it is still listen to all IP addresses. Or does this works different on linux
Code: Select all
# This setting sets the address for the daemon to listen on. Careful attention
# should be paid if this is assigned to anything other then the default, any.
# This setting can deny access to control of the daemon. Choose any if you want
# to have mpd listen on every address. Not effective if systemd socket
# activation is in use.
#
# For network
bind_to_address "localhost"
#
# And for Unix Socket
#bind_to_address "/run/mpd/socket"
#
# This setting is the TCP port that is desired for the daemon to get assigned
# to.
#
port "6600"
Re: Disable port 6600 from the "outside"
Check for multiple bind_to_address entries in mpd.conf and restart daemon.
Re: Disable port 6600 from the "outside"
Show me the output of: "ss -tlnep|grep mpd" (run it as root)
Re: Disable port 6600 from the "outside"
Code: Select all
pi@raspberry:~ $ sudo ss -tlnep|grep mpd
LISTEN 0 5 *:6600 *:* users:(("mpd",pid=480,fd=4),("systemd",pid=1,fd=33)) ino:9731 sk:4 v6only:0 <->
pi@raspberry:~ $
Re: Disable port 6600 from the "outside"
MPD doesn't use your configuration file.
Re: Disable port 6600 from the "outside"
How do you start MPD? Do you have to use the systemd socket?
If yes, read this: https://www.musicpd.org/doc/html/user.h ... activation
If yes, read this: https://www.musicpd.org/doc/html/user.h ... activation
Re: Disable port 6600 from the "outside"
Yes you are right systemd socket was active. So I have disabled it with
sudo systemctl stop mpd.socket
sudo systemctl disable mpd.socket
But now I have to enable systemd so it use the config file /etc/mpd.conf. And start mpd when the raspberry start.
When I run "sudo systemctl --user start mpd" I get the message “Failed to connect to bus: No such file or directory”
If I try to use "sudo systemctl enable mpd.service" it looks like it still use mpd.socket if I see the output below.
Synchronizing state of mpd.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable mpd
Created symlink /etc/systemd/system/sockets.target.wants/mpd.socket → /lib/systemd/system/mpd.socket.
And if I run "sudo ss -tlnep|grep mpd" it still listening to al addresses.
The question is what am I doing wrong???
sudo systemctl stop mpd.socket
sudo systemctl disable mpd.socket
But now I have to enable systemd so it use the config file /etc/mpd.conf. And start mpd when the raspberry start.
When I run "sudo systemctl --user start mpd" I get the message “Failed to connect to bus: No such file or directory”
If I try to use "sudo systemctl enable mpd.service" it looks like it still use mpd.socket if I see the output below.
Synchronizing state of mpd.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable mpd
Created symlink /etc/systemd/system/sockets.target.wants/mpd.socket → /lib/systemd/system/mpd.socket.
And if I run "sudo ss -tlnep|grep mpd" it still listening to al addresses.
The question is what am I doing wrong???
Re: Disable port 6600 from the "outside"
Why did you disable the systemd socket? Why not just change the listener settings in the systemd socket?
Why do you run "systemctl --user" with "sudo"? That doesn't make any sense. There's no "root" login session, you want your regular user's login session, and thus you shouldn't use "sudo".
And... SysV service script? What's that? Where does that come from?
I'm confused by your choices.
Why do you run "systemctl --user" with "sudo"? That doesn't make any sense. There's no "root" login session, you want your regular user's login session, and thus you shouldn't use "sudo".
And... SysV service script? What's that? Where does that come from?
I'm confused by your choices.
Re: Disable port 6600 from the "outside"
When I run "sudo systemctl --user start mpd" I get the message “Failed to connect to bus: No such file or directory” And the help says "In this configuration, MPD will ignore the listener settings (bind_to_address and port)."
And couldn't find any settings for the systemd socket. So I thought I had to switch. If you can tell me where I can find the config for systemd socket to set bind address to localhost then I'm going to try that.
And couldn't find any settings for the systemd socket. So I thought I had to switch. If you can tell me where I can find the config for systemd socket to set bind address to localhost then I'm going to try that.
Re: Disable port 6600 from the "outside"
Read the systemd documentation, this is not a MPD specific thing. If you don't want to learn about systemd, don't use its socket activation feature.
Re: Disable port 6600 from the "outside"
Oh joy of systemd
@Colin> Have a look at https://wiki.archlinux.org/index.php/Mu ... yer_Daemon - MPD acts different if started as root or user.

@Colin> Have a look at https://wiki.archlinux.org/index.php/Mu ... yer_Daemon - MPD acts different if started as root or user.
Re: Disable port 6600 from the "outside"
Hi skidoo,
Thank you for your answer. It's solved now.
Thank you for your answer. It's solved now.