0

I recently set up OpenVPN to run on a remote CentOS 7 server. Once I establish an OpenVPN connection to the remote server from my local machine, I am able to ssh through the VPN tunnel with ssh username@10.8.0.?. I can then run various commands on the remote machine (like cd, nano, etc.), all shielded by the VPN. But when I try to run firewall-cmd, I get an error and am not able to configure the firewall. Why is this? And what can I change so that I can configure the firewall from within my OpenVPN-encrypted ssh session?

For example, when I typed firewall-cmd --list-all, the terminal replied with:

ERROR:dbus.proxies:Introspect error on :1.4:/org/fedoraproject/FirewallD1: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 1 matched rules; type="method_call", sender=":1.2637" (uid=1000 pid=22130 comm="/usr/bin/python -Es /usr/bin/firewall-cmd --list-a") interface="org.freedesktop.DBus.Introspectable" member="Introspect" error name="(unset)" requested_reply="0" destination=":1.4" (uid=0 pid=728 comm="/usr/bin/python -Es /usr/sbin/firewalld --nofork -")
Error: Rejected send message, 1 matched rules; type="method_call", sender=":1.2637" (uid=1000 pid=22130 comm="/usr/bin/python -Es /usr/bin/firewall-cmd --list-a") interface="org.fedoraproject.FirewallD1" member="getDefaultZone" error name="(unset)" requested_reply="0" destination=":1.4" (uid=0 pid=728 comm="/usr/bin/python -Es /usr/sbin/firewalld --nofork -")

Note that when I ssh to the same server from outside the VPN tunnel, I am able to successfully configure the firewall with firewall-cmd. But I want to block access to ssh from outside the VPN, so I need to get ssh to work through the VPN.

  • you have to do it as root user. – taliezin Feb 18 '15 at 7:55
  • @taliezin Why is that? – CodeMed Feb 18 '15 at 18:54
  • at least it uses iptables and root can do it. I think you can try with sudo you can do it: sudo firewall-cmd --list-all – taliezin Feb 18 '15 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.