日志标签:centos

Centos 6.9升级openssh到7.7p1

分类:linux日期:2018-05-23 - 13:56:49评论:1条作者:老谢

开启telnet
yum install telnet-server
vi /etc/xinetd.d/telnet 
#默认telnet禁用root账户登陆,修改telnet配置文件,将配置文件中的disable         = no<修改为yes
 
vi /etc/securetty
 
#增加
#pts/0
#pts/1
#pts/2
#如果登录用户较多,需要更多的pts/*
 
/etc/init.d/xinetd start #启动xinetd进程。
安装相关组件并升级openssh
yum install -y gcc openssl-devel pam-devel rpm-build pam-devel 
wget http://ftp.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.7p1.tar.gz
rpm -e `rpm -qa | grep openssh` --nodeps
tar -zxvf openssh-7.7p1.tar.gz 
cd openssh-7.7p1
./configure --prefix=/usr --sysconfdir=/etc/ssh --with-pam --with-zlib --with-md5-passwords --with-tcp-wrappers
make && make install
 
vi /etc/ssh/sshd_config
#sed -i '/^#PermitRootLogin/s/#PermitRootLogin yes/PermitRootLogin yes/' /etc/ssh/sshd_config
#或手动修改PermitRootLogin no 修改为 PermitRootLogin yes 允许root远程登陆
 
service sshd restart 
#重启openssh
ssh -V
#查看版本
 
cp contrib/redhat/sshd.init /etc/init.d/sshd
chkconfig --add sshd
chkconfig sshd on
service sshd start
service sshd restart
chkconfig --list sshd
关闭telnet
/etc/init.d/xinetd stop && vi /etc/xinetd.d/telnet
将之前改过的disable=yes又改回去成no.
随后再将修改iptables将23端口关闭,并重启iptables服务.
至此,可以再开ssh登录,用ssh -V查看版本号.
Tags: , ,

Centos6升级Python2.7安装setuptools及pip

分类:linux日期:2016-02-27 - 10:12:07评论:3条作者:老谢

yum install -y zlib-devel bzip2-devel xz-libs xz wget git tar gcc gcc-c++ openssl openssl-devel pcre-devel python-devel libevent automake autoconf libtool make git
wget http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz
xz -d Python-2.7.8.tar.xz
tar -xvf Python-2.7.8.tar
cd Python-2.7.8
./configure --prefix=/usr/local
make && make altinstall
mv /usr/bin/python /usr/bin/python2.6.6
ln -s /usr/local/bin/python2.7 /usr/bin/python
 
wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-1.4.2.tar.gz
tar -xvf setuptools-1.4.2.tar.gz
cd setuptools-1.4.2
python2.7 setup.py install
 
wget --no-check-certificate https://pypi.python.org/packages/source/p/pip/pip-6.0.7.tar.gz
tar zxvf pip-6.0.7.tar.gz
cd pip-6.0.7
python setup.py install
Tags: ,

检查CentOS资源使用异常

分类:linux日期:2013-05-31 - 22:18:27评论:21条作者:老谢

正常我的VPS内存使用在220MB左右,由于一次折腾导致VPS重启后发现内存一直在330M左右,虽然我768MB的内存完全足够,但是对于一个有点小洁癖的人来说,无法忍受。。于是乎检查之。。。

[root@www ~]# ps -A --sort -rss -o comm,pmem,pcpu |uniq -c |head -15
      1 COMMAND         %MEM %CPU
      1 clamd           12.6  0.0
      1 httpd            4.2  0.1
      1 httpd            4.1  0.1
      1 iscsiuio         4.1  0.0
      1 httpd            4.1  0.2
      1 httpd            4.0  0.1
      1 httpd            3.9  0.1
      1 httpd            3.8  0.1
      1 httpd            3.8  0.4
      1 httpd            1.4  0.1
      1 httpd            1.1  0.0
      1 httpd            1.0  0.2
      1 mysqld           1.0  1.4
      1 httpd            0.8  0.0

clamd居然吃了12.6%的内存,猛然想起来这货是我装的一个杀软…卸载后完事….

接着还有iscsiuio这个东西,至于这是什么。。老谢也不知道。。man了一下,描述如下:

DESCRIPTION
iscsiuio is the UserSpace I/O driver for the Broadcom NetXtreme II BCM5706/5708/5709 series PCI/PCI-X Gigabit
Ethernet Network Interface Card (NIC) and for the Broadcom NetXtreme II BCM57710/57711/57712/57800/57810/57840
series PCI-E 10 Gigabit Ethernet Network Interface Card. The driver has been tested on 2.6.28 kernels and
above.

Refer to the README.TXT from the driver package on how to compile and install the driver.

Refer to various Linux documentations on how to configure network protocol and address.

没看懂啥意思,反正国内外论坛都搜了,说是可以关闭,不对系统造成影响,既然如此就关掉好了

chkconfig iscsi off
chkconfig iscsid off
service iscsid stop

接着…..世界终于爽了………

[root@www ~]# vmstat -S M
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0      0    548      0     69    0    0    22    10    0  161  4  0 87  9  0
[root@www ~]# free -m
             total       used       free     shared    buffers     cached
Mem:           768        219        548          0          0         68
-/+ buffers/cache:        150        617
Swap:            0          0          0

PS:服务商一定喜欢我酱紫的客户….Orz

Tags:

CentOS安装vnstat监控流量并配置vnstat PHP frontend

分类:linux日期:2013-05-31 - 10:06:13评论:1条作者:老谢

CentOS安装vnstat监控流量并配置vnstat PHP frontend

wget https://acelnmp.googlecode.com/files/vnstat-1.10.tar.gz
tar xvzf vnstat-1.10.tar.gz
cd vnstat-1.10/
make && make install
/usr/bin/vnstat -u -i eth0
vim /etc/cron.d/vnstat
0-55/5 * * * *   root   vnstat -u -i eth0
0-55/5 * * * *   root   vnstat --dumpdb -i eth0 >/var/lib/vnstat/vnstat_dump_eth0
wget http://www.sqweek.com/sqweek/files/vnstat_php_frontend-1.5.1.tar.gz
tar -zxf vnstat_php_frontend-1.5.1.tar.gz
mv vnstat_php_frontend-1.5.1.tar.gz vnstat

继续阅读…

Tags: ,