Centos 6.8 安装 jumpserver

系统环境:

cat /etc/redhat-release

CentOS release 6.8 (Final)

Ip192.168.137.31

一.关闭selinux

[root@localhost ~]# sed -i '/SELINUX=/s/enforcing/disabled/' /etc/selinux/config

[root@localhost ~]# cat /etc/selinux/config

临时设置关闭

[root@localhost ~]# setenforce 0

[root@localhost ~]# getenforce 0

Permissive

二.测试的先关闭防火墙,测试完成再开启,添加相应的端口

[root@localhost ~]# service iptables stop

[root@localhost ~]# iptables -nL

三.升级python2.6python2.7

[root@localhost ~]# wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.bz2

[root@localhost ~]# tar -jxvf Python-2.7.3.tar.bz2

[root@localhost ~]# cd Python-2.7.3

[root@localhost Python-2.7.3]# ./configure

[root@localhost Python-2.7.3]# make all

[root@localhost Python-2.7.3]# make && make install

[root@localhost Python-2.7.3]# make clean

[root@localhost Python-2.7.3]# mv /usr/bin/python /usr/bin/python.bak

[root@localhost bin]# ln -s /usr/local/bin/python2.7 /usr/bin/python

python -V检验是否成功

vim /usr/bin/yum

把第一行改为#!/usr/bin/python2.6

四.安装pip

[root@localhost ~]# curl -O https://pypi.python.org/packages/source/p/pip/pip-7.1.2.tar.gz

[root@localhost ~]# tar zxvf pip-7.1.2.tar.gz

[root@localhost ~]# cd pip-7.1.2

[root@localhost pip-7.1.2]# python setup.py install #如果以下报错,是缺少setuptools模块

Traceback (most recent call last):

File "setup.py",line 6,in <module>

from setuptools import setup,find_packages

ImportError: No module named setuptools

安装setuptools模块

[root@localhost ~]#

wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e --no-check-certificate

[root@localhost ~]# tar -zxvf setuptools-0.6c11.tar.gz

[root@localhost ~]# cd setuptools-0.6c11

[root@localhost setuptools-0.6c11]# python setup.py install

#出现以下报错,则是缺少zlib模块跟相关的依赖包:

File "setup.py",line 94,in <module>

scripts = scripts,

File "/usr/local/lib/python2.7/distutils/core.py",line 152,in setup

dist.run_commands()

File "/usr/local/lib/python2.7/distutils/dist.py",line 953,in run_commands

self.run_command(cmd)

File "/usr/local/lib/python2.7/distutils/dist.py",line 972,in run_command

cmd_obj.run()

File "/root/setuptools-0.6c11/setuptools/command/install.py",line 76,in run

self.do_egg_install()

File "/root/setuptools-0.6c11/setuptools/command/install.py",line 96,in do_egg_install

self.run_command('bdist_egg')

File "/usr/local/lib/python2.7/distutils/cmd.py",line 326,in run_command

self.distribution.run_command(command)

File "/usr/local/lib/python2.7/distutils/dist.py",in run_command

cmd_obj.run()

File "/root/setuptools-0.6c11/setuptools/command/bdist_egg.py",line 236,in run

dry_run=self.dry_run,mode=self.gen_header())

File "/root/setuptools-0.6c11/setuptools/command/bdist_egg.py",line 527,in make_zipfile

z = zipfile.ZipFile(zip_filename,mode,compression=compression)

File "/usr/local/lib/python2.7/zipfile.py",line 681,in __init__

"Compression requires the (missing) zlib module"

RuntimeError: Compression requires the (missing) zlib module

[root@localhost setuptools-0.6c11]# yum install zlib-devel

安装完zlib-devel依赖包或者模块,需要重新编译一下就可以了

root@localhost ~]# cd Python-2.7.3

[root@localhost Python-2.7.3]# make && make install

[root@localhost Python-2.7.3]# cd /root/setuptools-0.6c11

[root@localhost setuptools-0.6c11]# python setup.py install #成功执行

再去到pip路径重新执行pip程序就显示可以了

[root@localhost setuptools-0.6c11]# cd /root/pip-7.1.2

[root@localhost pip-7.1.2]# python setup.py install

[root@localhost pip-7.1.2]# ln -s /usr/local/bin/pip2.7 /usr/bin/pip

[root@localhost pip-7.1.2]# pip list #出现以下报错

Traceback (most recent call last):

File "/usr/local/bin/pip",line 8,in <module>

load_entry_point('pip==7.1.2','console_scripts','pip')()

File "build/bdist.linux-x86_64/egg/pkg_resources.py",line 318,in load_entry_point

File "build/bdist.linux-x86_64/egg/pkg_resources.py",line 2221,line 1954,in load

File "/usr/local/lib/python2.7/site-packages/pip-7.1.2-py2.7.egg/pip/__init__.py",line 15,in <module>

from pip.vcs import git,mercurial,subversion,bazaar # noqa

File "/usr/local/lib/python2.7/site-packages/pip-7.1.2-py2.7.egg/pip/vcs/subversion.py",line 9,in <module>

from pip.index import Link

File "/usr/local/lib/python2.7/site-packages/pip-7.1.2-py2.7.egg/pip/index.py",line 30,in <module>

from pip.wheel import Wheel,wheel_ext

File "/usr/local/lib/python2.7/site-packages/pip-7.1.2-py2.7.egg/pip/wheel.py",line 35,in <module>

from pip._vendor.distlib.scripts import ScriptMaker

File "/usr/local/lib/python2.7/site-packages/pip-7.1.2-py2.7.egg/pip/_vendor/distlib/scripts.py",line 14,in <module>

from .compat import sysconfig,detect_encoding,ZipFile

File "/usr/local/lib/python2.7/site-packages/pip-7.1.2-py2.7.egg/pip/_vendor/distlib/compat.py",line 31,in <module>

from urllib2 import (Request,urlopen,URLError,HTTPError,

ImportError: cannot import name HTTPSHandler

处理:yum 安装openssl openssl-devel,然后重新编译python

[root@localhost pip-7.1.2]# yum install openssl openssl-devel

[root@localhost pip-7.1.2]# cd /root/Python-2.7.3

再回到pip目录

[root@localhost Python-2.7.3]# cd /root/pip-7.1.2

[root@localhost pip-7.1.2]# pip list

pip (7.1.2)

setuptools (0.6rc11)

/usr/local/lib/python2.7/site-packages/pip-7.1.2-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information,see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

InsecurePlatformWarning

You are using pip version 7.1.2,however version 9.0.1 is available.

You should consider upgrading via the 'pip install --upgrade pip' command.

版本太低了,我们升级一下pip

[root@localhost pip-7.1.2]# pip install -U pip

[root@localhost pip-7.1.2]# pip list

DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.

pip (9.0.1)

setuptools (0.6rc11)

上面出现就说明好了,只是告警信息,可以忽略

五.安装依赖rpm下载阿里云的yum

[root@localhost~]#wget-O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

[root@localhost ~]# yum clean all

[root@localhost ~]# yum install epel-release

[root@localhost ~]# yum install epel-release -y

[root@localhost ~]# yum install python-pip MysqL-devel gcc automake autoconf python-devel vim sshpass lrzsz -y

六.下载jumpserver

[root@localhost ~]# cd /opt

[root@localhost opt]# yum install git -y

[root@localhost opt]# git clone https://github.com/ibuler/jumpserver.git

执行快速安装脚本

[root@localhost opt]# cd jumpserver/install && pip install -r requirements.txt

[root@localhost jumpserver]# cd install/

[root@localhost install]# python install.py

Traceback (most recent call last):

File "install.py",in <module>

import readline

ImportError: No module named readline#缺少realine模块

[root@localhost install]# wget https://pypi.python.org/packages/source/r/readline/readline-6.2.4.1.tar.gz#md5=578237939c81fdbc2c8334d168b17907 --no-check-certificate

[root@localhost install]# tar -zxvf readline-6.2.4.1.tar.gz

[root@localhost install]# cd readline-6.2.4.1

root@localhost readline-6.2.4.1]# python setup.py install

报错:

gcc -pthread -shared build/temp.linux-x86_64-2.7/Modules/2.x/readline.o readline/libreadline.a readline/libhistory.a -lncurses -o build/lib.linux-x86_64-2.7/readline.so

/usr/bin/ld: cannot find -lncurses

collect2: ld returned 1 exit status

error: command 'gcc' Failed with exit status 1

解决:

更新系统内核,安装ncurses依赖包

[root@localhost ~]# yum install kernel devel

[root@localhost ~]# yum install ncurses-devel

[root@localhost ~]# [root@localhost ~]# cd readline-6.2.4.1

[root@localhost readline-6.2.4.1]# python setup.py install

[root@localhost readline-6.2.4.1]# cd /opt/jumpserver/install/

[root@localhost install]# python install.py

[root@localhost install]# python install.py

除了自己填自己的邮箱,账号和密码,还有设置jump的账号密码,其他默认


wKioL1muTn2QzT1BAACNvKlynOs176.png-wh_50

wKiom1muTprxorY8AAAWMDq935Y467.png-wh_50

wKiom1muTpzx3baTAABT_TNyXzY925.png-wh_50


七.最后输入自己的服务器或者虚拟机ip即可

运行 crontab,定期处理失效连接,定期更新资产信息
[root@localhost ~]#cd /opt/jumpserver
[root@localhost ~]#python manage.py crontab add

wKiom1muTp7h72CwAAFTyRYKfN4542.png-wh_50

8.更新代码
[root@localhost ~]#cd /opt/jumpserver
[root@localhost ~]#git pull

centos   安装 jumpserver的更多相关文章

  1. xamarin.ios – ShareKit与MonoTouch如何?

    有人可以验证ShareKit实际上是否可用于MonoTouch并指导我完成使其工作所需的步骤?解决方法您首先从getsharekit.com下载还是使用ShareKit2.0?

  2. ios – iPhone崩溃日志不能正确地符号化并且是双重间隔的

    任何建议超过欢迎.谢谢.解决方法当这件事发生在我身上时,它只是我通过电子邮件收到的日志.如果我记得,至少有一些是在.msg文件中,我不得不把它们拿出来.它可能是Exchange编码更改.如果你显示不可见的字符,你可能会看到每个字符之间的东西.您可以找到并替换它们以删除它们或更改编辑器中的编码.

  3. XCode 3.2 Ruby和Python模板

    在xcode3.2下,我的ObjectiveCPython/Ruby项目仍然可以打开更新和编译,但是你无法创建新项目.鉴于xcode3.2中缺少ruby和python的所有痕迹(即创建项目并添加新的ruby/python文件),是否有一种简单的方法可以再次安装模板?我发现了一些关于将它们复制到某个文件夹的信息,但我似乎无法让它工作,我怀疑文件夹的位置已经改变为3.2.解决方法3.2中的应用程序模板

  4. ios – Xcode 7 beta 2:LaunchScreen.storyboard无法打开文档

    我在两个不同的Mac(iMac和MacBookpro)上收到这个错误.不知道为什么人们不能再现它,但我需要一些帮助.在运行XX优胜美地10.10.4的Mac上运行Xcode7beta2(15六月’15).甚至无法编译和运行我的项目..我从创建菜单创建了一个视图应用程序项目,就是这样.编辑:我试图删除并重新添加storyboard文件(也可以打开Main.storyboard插件),我仍然得到相同的

  5. ios – 在/usr/lib/system/libcache.dylib中,缺少必需的架构armv6

    在试图为iphoneos编写一个虚拟程序时,Xcode4,gcc似乎没有超出初始的sysroot目录如果我把sysroot,以下作品,但感觉非常干酪,而且不可伸缩.这里发生了什么?

  6. Swift基本使用-函数和闭包(三)

    声明函数和其他脚本语言有相似的地方,比较明显的地方是声明函数的关键字swift也出现了Python中的组元,可以通过一个组元返回多个值。传递可变参数,函数以数组的形式获取参数swift中函数可以嵌套,被嵌套的函数可以访问外部函数的变量。可以通过函数的潜逃来重构过长或者太复杂的函数。

  7. 10 个Python中Pip的使用技巧分享

    众所周知,pip 可以安装、更新、卸载 Python 的第三方库,非常方便。本文小编为大家总结了Python中Pip的使用技巧,需要的可以参考一下

  8. Swift、Go、Julia与R能否挑战 Python 的王者地位

    本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请发送邮件至dio@foxmail.com举报,一经查实,本站将立刻删除。

  9. 红薯因 Swift 重写开源中国失败,貌似欲改用 Python

    本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请发送邮件至dio@foxmail.com举报,一经查实,本站将立刻删除。

  10. Swift 2/iOS 9 – libz.dylib找不到

    我在我的新的Swift2.0项目中使用一些来自google的外部代码,在早期版本中需要“libz.dylib”。更新到新的XCode/新的SDK后。

随机推荐

  1. 在airgapped(离线)CentOS 6系统上安装yum软件包

    我有一个CentOS6系统,出于安全考虑,它已经被空气泄漏.它可能从未连接到互联网,如果有,它很长时间没有更新.我想将所有.rpm软件包放在一个驱动器上,这样它们就可以脱机安装而无需查询互联网.但是,我在测试VM上遇到的问题是,即使指定了本地路径,yum仍然会挂起并尝试从在线存储库进行更新.另外,有没有办法使用yum-utils/yumdownloader轻松获取该包的所有依赖项和所有依赖项?目前

  2. centos – 命名在日志旋转后停止记录到rsyslog

    CentOS6.2,绑定9.7.3,rsyslog4.6.2我最近设置了一个服务器,我注意到在日志轮换后,named已停止记录到/var/log/messages.我认为这很奇怪,因为所有日志记录都是通过rsyslog进行的,并且named不会直接写入日志文件.这更奇怪,因为我在更新区域文件后命名了HUPed,但它仍然没有记录.在我停止并重新启动命名后,记录恢复.这里发生了什么?

  3. centos – 显示错误的磁盘大小

    对于其中一个磁盘,Df-h在我的服务器上显示错误的空白区域:Cpanel表明它只有34GB免费,但还有更多.几分钟前,我删除了超过80GB的日志文件.所以,我确信它完全错了.fdisk-l/dev/sda2也显示错误:如果没有格式化,我该怎么做才能解决这个问题?并且打开文件描述符就是它需要使用才能做到这一点.所以…使用“lsof”并查找已删除的文件.重新启动写入日志文件的服务,你很可能会看到空间可用.

  4. 如何在centos 6.9上安装docker-ce 17?

    我目前正在尝试在centOS6.9服务器上安装docker-ce17,但是,当运行yuminstalldocker-ce时,我收到以下错误:如果我用跳过的标志运行它我仍然得到相同的消息,有没有人知道这方面的方法?

  5. centos – 闲置工作站的异常负载平均值

    我有一个新的工作站,具有不寻常的高负载平均值.机器规格是:>至强cpu>256GB的RAM>4x512GBSSD连接到LSI2108RAID控制器我从livecd安装了CentOS6.564位,配置了分区,网络,用户/组,并安装了一些软件,如开发工具和MATLAB.在启动几分钟后,工作站负载平均值的值介于0.5到0.9之间.但它没有做任何事情.因此我无法理解为什么负载平均值如此之高.你能帮我诊断一下这个问题吗?

  6. centos – Cryptsetup luks – 检查内核是否支持aes-xts-plain64密码

    我在CentOS5上使用cryptsetupluks加密加密了一堆硬盘.一切都很好,直到我将系统升级到CentOS6.现在我再也无法安装磁盘了.使用我的关键短语装载:我收到此错误:在/var/log/messages中:有关如何装载的任何想法?找到解决方案问题是驱动器使用大约512个字符长的交互式关键短语加密.出于某种原因,CentOS6中的新内核模块在由旧版本创建时无法正确读取512个字符的加密密钥.似乎只会影响内核或cryptsetup的不同版本,因为在同一系统上创建和打开时,512字符的密钥将起作用

  7. centos – 大量ssh登录尝试

    22个我今天登录CentOS盒找到以下内容这是过去3天内的11次登录尝试.WTF?请注意,这是我从我的提供商处获得的全新IP,该盒子是全新的.我还没有发布任何关于此框的内容.为什么我会进行如此大量的登录尝试?是某种IP/端口扫描?基本上有4名匪徒,其中2名来自中国,1名来自香港,1名来自Verizon.这只发生在SSH上.HTTP上没有问题.我应该将罪魁祸首子网路由吗?你们有什么建议?

  8. centos – kswap使用100%的CPU,即使有100GB的RAM也可用

    >Linux内核是否应该足够智能,只需从内存中清除旧缓存页而不是启动kswap?

  9. centos – Azure将VM从A2 / 3调整为DS2 v2

    我正在尝试调整前一段时间创建的几个AzureVM,从基本的A3和标准A3到标准的DS2v2.我似乎没有能力调整到这个大小的VM.必须从头开始重建服务器会有点痛苦.如果它有所不同我在VM中运行CentOS,每个都有一个带有应用程序和操作系统的磁盘.任何人都可以告诉我是否可以在不删除磁盘的情况下删除VM,创建新VM然后将磁盘附加到新VM?

  10. centos – 广泛使用RAM时服务器计算速度减慢

    我在非常具体的情况下遇到服务器速度下降的问题.事实是:>1)我使用计算应用WRF>2)我使用双XeonE5-2620v3和128GBRAM(NUMA架构–可能与问题有关!

返回
顶部