当前位置: 首页 > article >正文

SySeVR环境配置和可能的问题

SySeVR环境配置

文章目录

  • SySeVR环境配置
    • 0. docker
    • 1. apt及一些依赖包
    • 2. python/pip
    • 3. 相关源码拉取, 项目组织
    • 4. joern/neo4j
    • 5. pip
    • 6. 验证
    • 7. 启动ssh(可选)

顺着输就行了

注意ubuntu22.04及以上不再支持python2, 可以装ubuntu20.04

uname -m

x86-64对应amd64

0. docker

docker run --name wh_kvmodel_slice -it -p 1022:22 -p 1888:8888 -p 1474:7474 -p 1687:7687 -v wh_kvmodel:/home --gpus all --workdir /home -d --ipc=host ubuntu:20.04 tail -f /dev/null

docker exec -it wh_kvmodel_slice bash

配置详情

  1. host-port–1888: jupyter
  2. host-port–1474: neo4j-console
  3. host-port–1687: neo4j
  4. host-port–1022: ssh
  5. work_dir: /home -> /home/nfs/docker/volumes/wh_kvmodel/_data

1. apt及一些依赖包

apt update
apt install openssh-server git vim graphviz libgraphviz-dev graphviz-dev pkg-config unzip p7zip-full #openjdk-8-jdk

apt update报错说明源有问题看下apt源怎么配, 没配好不要进入下面的步骤

2. python/pip

apt install python-dev python-setuptools
apt install python2
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
python2 get-pip.py
apt install python3 python3-pip

python2 -m pip install pip --upgrade
python3 -m pip install pip --upgrade

3. 相关源码拉取, 项目组织

cd /home
git clone https://github.com/SySeVR/SySeVR.git
git clone https://github.com/ZigZagframework/zigzag_framework.git
git clone https://github.com/speeDy167/SySeVRs_NT521.O11.ANTN.git
cp -r SySeVRs_NT521.O11.ANTN/Tools SySeVR/Tools
rm -r SySeVR/Tools/joern-0.3.1
cp -r zigzag_framework/ZigZag/SySeVR/joern-0.3.1 SySeVR/Tools/joern-0.3.1
cp -r /home/SySeVR/SySeVR_docker/docker_build/home/SySeVR/softdir/jdk1.8.0_161 SySeVR/Tools/jdk1.8.0_161

4. joern/neo4j

vim ~/.bashrc

=========把这些输到~/.bashrc里===============
alias vb="vim ~/.bashrc"
alias s="source ~/.bashrc"
export SHOME=/home/SySeVR
export SDEP=/home/SySeVR/Tools
export JHOME=$SDEP/joern-0.3.1
export NHOME=$SDEP/neo4j
export AHOME=$SDEP/apache-ant-1.9.14
export JAVA_HOME=$SDEP/jdk1.8.0_161
export JAVAB=$JAVA_HOME/bin
export JB=$JHOME/bin
export NB=$NHOME/bin
export AB=$AHOME/bin
export PATH=$PATH:$AB:$JB:$NB:$JAVAB
alias joern='java -jar $JB/joern.jar'


chmod 777 $JB/*
chmod 777 $AB/*
chmod 777 $NB/*
chmod 777 $JAVAB/*
==========================================

source ~/.bashrc

cd $JHOME && ant

5. pip

python2 $SDEP/py2neo-py2neo-2.0/setup.py install
python2 $SDEP/python-joern-0.3.1/setup.py install
python2 -m pip install python-igraph==0.8.3
python3 -m pip install xlrd gensim==3.8.3 imbalanced-learn==0.4.0 scikit-learn==1.3.2 tensorflow==2.8.0 keras==2.8.0

所有在pip install过程中编译相关的问题基本上是和pip版本有关, 可以尝试更新pippython2 -m pip install pip --upgrade && python3 -m pip install pip --upgrade, 或者报错中提示的依赖(不推荐)

6. 验证

joern
java -version
neo4j

7. 启动ssh(可选)

mkdir ~/.ssh && vim ~/.ssh/authorized_keys	# 把公钥输进去
vim /etc/ssh/sshd_config

========================================
# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostKey /etc/ssh/ssh_host_ed25519_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 1024

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin prohibit-password
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile     %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM yes
                                                
=============================================



passwd
service ssh start 
ps -e | grep ssh

http://www.kler.cn/a/586426.html

相关文章:

  • docker修改了daemon.js文件还是下载不了镜像
  • Vue 中如何使用 nextTick?
  • 【学习笔记】中缀表达式转后缀表达式及计算
  • 编程助手学Python--Deepseek对Langchain的调用OpenAI的GPT-3.5模型起名字与格式化输出
  • Git基础篇 - Linux(CentOS)源码安装Git实例
  • 四元数 实部 虚部顺序,不同仿真器
  • 鸿蒙next 多行文字加图片后缀实现方案
  • Win10 下搭建免费的 FTP 服务器 FileZilla
  • Ubuntu 配置 github 代理
  • Ktor库使用HTTP编写了一个下载程序
  • LinuX---搜索查找类命令
  • PHP语法基础
  • Nginx + Docker 反向代理多个项目
  • Flutter 学习之旅 之 flutter 实现简单自定义的倒计时 CountdownTimer 功能/监听倒计时开始/结束/计时中的事件
  • px4中的UAVCAN_V1特点与仲裁原理
  • 数据分析项目:基于LSTM的微博评论情感分析
  • ctf-web: xss 任意位置插入情况绕过 DOMPurify -- tpctf layout
  • XEngine Kit
  • SCSS详解
  • fastapi+angular实现Tcp在线聊天室功能