#!/bin/shyum -y install gcc cmake bison pkgconfig libuuid-devel hiredis-devel openldap-devel libgcrypt-devel libksba-devel gnutls-devel glib2-devel openssl-devel gpgme-devel zlib-devel net-snmp-devel libssh-devel sqlite-devel sqlite libmicrohttpd-devel libxml-devel libexslt-devel libmicrohttpd-devel libxml-devel libexslt-devel libxslt-devel redis gnutls-utilsexport PKG_CONFIG_PATH=/usr/local/lib/pkgconfigecho "/usr/local/lib" >> /etc/ld.so.conf.d/openvas.confldconfigmkdir -p /opt/openvascd /opt/openvaswget http://wald.intevation.org/frs/download.php/2420/openvas-libraries-9.0.1.tar.gztar zxf openvas-libraries-9.0.1.tar.gz && cd openvas-libraries-9.0.1mkdir build && cd buildcmake ..make && make installcd /opt/openvaswget http://wald.intevation.org/frs/download.php/2423/openvas-scanner-5.1.1.tar.gztar zxf openvas-scanner-5.1.1.tar.gz && cd openvas-scanner-5.1.1mkdir build && cd buildcmake ..make && make installcd /opt/openvaswget http://wald.intevation.org/frs/download.php/2448/openvas-manager-7.0.2.tar.gztar zxf openvas-manager-7.0.2.tar.gz && cd openvas-manager-7.0.2mkdir build && cd buildcmake ..make && make installcd /opt/openvaswget http://wald.intevation.org/frs/download.php/2429/greenbone-security-assistant-7.0.2.tar.gztar zxf greenbone-security-assistant-7.0.2.tar.gz && cd greenbone-security-assistant-7.0.2mkdir build && cd buildcmake ..make && make install#同步漏洞库greenbone-nvt-sync#同步其他数据greenbone-scapdata-sync#创建用户openvasmd --create-user=admin --role=AdminUser created with password 'd4818697-8999-4355-ba08-f039eb582d2b'#修改密码openvasmd --user=admin --new-password=12345#安装证书openvas-manage-certs -a#启动openvasmd#gsadgsad --http-only --listen="0.0.0.0"#关闭防火墙systemctl stop firewalldsystemctl disable firewalld
yum 安装的redis需要修改配置
vim /etc/redis.conf
unixsocket /tmp/redis.sock
unixsocketperm 700重新启动redis
错误解决:
/usr/bin/ld: libmanage.a(lsc_crypt.c.o): undefined reference to symbol 'gpg_strerror'
/usr/lib64/libgpg-error.so.0: error adding symbols: DSO missing from command linecd /opt/openvas/openvas-manager-7.0.2/build
vim src/CMakeFiles/openvasmd-sqlite.dir/link.txt
添加:-lgpg-error
修改完成后重新make && make install