Gvm connection

hi
i using this code to connect to the server but its not working

x=gvm.connections.SSHConnection(hostname=‘192.168.29.130’,port=22,username=‘root’,password=‘toor’)
transform=EtreeCheckCommandTransform()
gmp=Gmp(x)
gmp.authenticate(username=‘admin’,password=‘123’)
gmp.get_version()

and give me this error gvm.errors.GvmError: Remote closed the connection
please help me how i can use ssh connection

I am trying to connect a remote scanner using python-gvm api. I have tried using SSH but its not working, I have added complete details on stackvoerflow link. Can somebody please help ?

I am looking for scanner which can be managed by API using python or java.

Connecting via SSH only works out-of-the-box with a Greenbone Appliance. For the GSE you have to figure out how to setup up SSH by yourself.

Btw. you can’t connect to the scanner directly. With GMP you are always creating connections to the management daemon.

2 Likes

You may can tell me if i have to make override the check-gmp.gmp script so that its make an connection, or is it possible to make an ssh connection and then make a command with gvm-script socket… I attention to connect the GVM with Nagios in using the check-gmp.gmp?
Atm i try to run the follow command from the CheckMK Server like that:
ssh greenbone -T “gvm-script socket --socketpath /home/user/install/var/run/gvmd.sock /home/user/scripts/check-gmp.gmp -V”

but thats return me:
bash: gvm-script: command not found

but if i connect normaly per ssh on my greenbone server with “ssh greenbone” and than start the gvm-script command “gvm-script socket --socketpath /home/user/install/var/run/gvmd.sock /home/user/scripts/check-gmp.gmp -V” it give me the current version…