GVM ERROR - PermissionError: [Errno 13] Permission denied

from gvm.connections import UnixSocketConnection
from gvm.protocols.gmp import Gmp

path to unix socket

path = ‘/var/run/gvmd.sock’
connection = UnixSocketConnection(path=path)

using the with statement to automatically connect and disconnect to gvmd

with Gmp(connection=connection) as gmp:
# get the response message returned as a utf-8 encoded string
response = gmp.get_version()

# print the response message
print(response)

When I run the above code I get following error

bhagyashree@bhagyashree-Inspiron-3521:~/Desktop$ python3 test.py
Traceback (most recent call last):
File “test.py”, line 9, in
with Gmp(connection=connection) as gmp:
File “/home/bhagyashree/.local/lib/python3.6/site-packages/gvm/protocols/gmp.py”, line 121, in enter
gmp = self.determine_supported_gmp()
File “/home/bhagyashree/.local/lib/python3.6/site-packages/gvm/protocols/gmp.py”, line 102, in determine_supported_gmp
version = self.determine_remote_gmp_version()
File “/home/bhagyashree/.local/lib/python3.6/site-packages/gvm/protocols/gmp.py”, line 85, in determine_remote_gmp_version
self.connect()
File “/home/bhagyashree/.local/lib/python3.6/site-packages/gvm/protocols/base.py”, line 107, in connect
self._connection.connect()
File “/home/bhagyashree/.local/lib/python3.6/site-packages/gvm/connections.py”, line 358, in connect
self._socket.connect(self.path)
PermissionError: [Errno 13] Permission denied

Can someone please help me why am I getting this error

Please fix your filesystem / socket permissions. This is not a generic Linux beginner forum, so you should know how filesystem permissions work if not you are definitive on the wrong way with the source edition.

2 Likes

Thanks for the reply, I have also posted another topic related to socket error. I would be very grateful if I get an answer for that too.