操作系统(Linux)
Jul 1

centos6.5安装rzsz命令
默认只要root有权限安装
[hadoop@itlife365 sbin]$ rz
-bash: rz: command not found
[hadoop@itlife365 sbin]$ sz
-bash: sz: command not found
[hadoop@itlife365 sbin]$ yum install lrzsz
Loaded plugins: fastestmirror
You need to be root to perform this command.
[hadoop@itlife365 sbin]$

[hadoop@itlife365 ~]$ su - root
Password:
[root@itlife365 ~]# yum install lrzsz
Loaded plugins: fastestmirror
Determining fastest mirrors
base                                                                                | 3.7 kB     00:00    
base/primary_db                                                                     | 3.7 MB     00:02    
extras                                                                              | 3.3 kB     00:00    
extras/primary_db                                                                   |  21 kB     00:00    
updates                                                                             | 3.4 kB     00:00    
updates/primary_db                                                                  | 1.9 MB     00:01    
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package lrzsz.i686 0:0.12.20-27.1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================
 Package               Arch                 Version                             Repository            Size
===========================================================================================================
Installing:
 lrzsz                 i686                 0.12.20-27.1.el6                    base                  66 k

Transaction Summary
===========================================================================================================
Install       1 Package(s)

Total download size: 66 k
Installed size: 150 k
Is this ok [y/N]: y
Downloading Packages:
lrzsz-0.12.20-27.1.el6.i686.rpm                                                     |  66 kB     00:00    
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : lrzsz-0.12.20-27.1.el6.i686                                                             1/1
  Verifying  : lrzsz-0.12.20-27.1.el6.i686                                                             1/1

Installed:
  lrzsz.i686 0:0.12.20-27.1.el6                                                                           

Complete!
[root@itlife365 ~]#
安装完成后测试:在hadoop用户下就可以了
[hadoop@itlife365 sbin]$ rz
rz waiting to receive.
开始 zmodem 传输.  按 Ctrl+C 取消.
Transferring rpc-service_runable.jar...
   86%   19885 KB  864 KB/s 00:00:03 ETA   0 错误

---end by itlife365.com centos linux sz rz

Tags: , , ,
Dec 11

国内使用Linux CentOS6.5中如何修改yum源
一般默认安装的系统配置的都是国外的yum源,经常会出错,或者网络差的时候经常yum安装失败,
这时候需要更新为国内的
在安装完CentOS后一般需要修改yum源,才能够在安装更新rpm包时获得比较理想的速度。
国内比较快的有阿里云源、163源、sohu源。
这里以163源为例子。
步骤如下:root用户
1. cd /etc/yum.repos.d
2. mv CentOS-Base.repo CentOS-Base.repo.backup
3. wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
如果不能在Linux下载或者还没有安装wget 则可以通过网络访问下载本地后写入
如下的情况表示还没有安装
[root@itlife365 ~]#  wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
-bash: wget: command not found
[root@itlife365 ~]#

4. mv CentOS6-Base-163.repo CentOS-Base.repo
5.yum clean all
。。。。。
CentOS6-Base-163.repo 可以参考附件(把.txt重命名)


然后就可以安装wget了
[root@itlife365 yum.repos.d]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up Everything
[root@itlife365 yum.repos.d]# yum install wget
Loaded plugins: fastestmirror
Determining fastest mirrors
base                                                                                | 3.7 kB     00:00    
base/primary_db                                                                     | 3.7 MB     00:02    
extras                                                                              | 3.3 kB     00:00    
extras/primary_db                                                                   |  30 kB     00:00    
updates                                                                             | 3.4 kB     00:00    
updates/primary_db                                                                  | 3.5 MB     00:02    
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package wget.i686 0:1.12-8.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================
 Package                Arch                   Version                        Repository              Size
===========================================================================================================
Installing:
 wget                   i686                   1.12-8.el6                     base                   483 k

Transaction Summary
===========================================================================================================
Install       1 Package(s)

Total download size: 483 k
Installed size: 1.8 M
Is this ok [y/N]: y
Downloading Packages:
wget-1.12-8.el6.i686.rpm                                                            | 483 kB     00:04    
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
 Userid: "CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>"
 From  : http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
Is this ok [y/N]: y
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : wget-1.12-8.el6.i686                                                                    1/1
  Verifying  : wget-1.12-8.el6.i686                                                                    1/1

Installed:
  wget.i686 0:1.12-8.el6                                                                                  

Complete!
[root@itlife365 yum.repos.d]# pwd
/etc/yum.repos.d
[root@itlife365 yum.repos.d]#

how-centos6-5-update-yum-source-in-china
---END

Tags: , ,
Nov 30

CentOS Linux出现Device eth0 does not seem to be present的解决
在Oracle VBOX里复制虚拟机出来的CentOS Linux配置完成Ip,重启网卡报错
故障现象:
service network restart
Shutting down loopback insterface:                       [  OK  ]
Bringing up loopback insterface:                         [  OK  ]
Bringing up interface eth3:  Device eth3 does not seem to be present,delaying initialization.   [FAILED]
因为我的是复制第3次,且复制的时候选择了重新初始化网卡,所以会出现eth3 (后面自己才发现的。。)

CentOS Linux解决Device eth3 does not seem to be present
ifconfig...没有看到eth0.。然后重启网卡又报下面错误。

我的解决办法:
1/首先打开/etc/udev/rules.d/70-persistent-net.rules内容如下面例子所示:

# vi /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:8f:89:9
7", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:50:bd:1
7", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:51:bd:1
7", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
# PCI device 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:52:bd:1
7", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"

然后记录下eth3网卡的mac地址00:0c:29:52:bd:17
因为我的ifcfg-eth0还没使用,所以我直接改ifcfg-eth3 为ifcfg-eth0了
2、接下来,打开/etc/sysconfig/network-scripts/ifcfg-eth0
# vi /etc/sysconfig/network-scripts/ifcfg-eth0

将 DEVICE="eth3"  改成  DEVICE="eth0"  ,
将 HWADDR="00:0c:29:8f:89:97" 改成上面的mac地址  HWADDR="00:0c:29:52:bd:17"
3、最后,重启网络
# service network restart
或者
# /etc/init.d/network restart

正常了,如果还是不行重启虚拟机的系统(我的重启后ok)centos device
how to solve centos Device eth0 does not seem to be present

Tags: ,
Jun 19

ie访问:waimao.jiandanjie.com 报如下错误:
Forbidden
You don't have permission to access /index.html on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
--------------------------------------------------------------------------------
Apache/2.2.15 (CentOS) Server at waimao.jiandanjie.com Port 80

参考后台log日志:
[Sun Jun 19 15:32:46 2016] [crit] [client 183.250.114.92] (13)Permission denied: /var/www/waimao.jiandanjie.com/web/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
[Sun Jun 19 15:34:58 2016] [crit] [client 183.250.114.92] (13)Permission denied: /var/www/waimao.jiandanjie.com/web/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable
百度了一下,原来是权限的问题。 chmod 755 web -R 后解决

[root@server1 waimao.jiandanjie.com]# ll
total 28
drwxr-xr-x  2 web13 client3 4096 Jun 17 23:26 cgi-bin
drwxr-xr-x  2 root  root    4096 Jun 19 15:22 log
drwx--x---  2 web13 client3 4096 Jun 17 23:26 private
drwxr-xr-x  2 root  root    4096 Jun 17 23:26 ssl
drwxrwxrwx  2 web13 client3 4096 Jun 17 23:26 tmp
drwx--x--- 12 web13 client3 4096 Jun 19 15:30 web
drwx--x---  2 web13 client3 4096 Jun 17 23:26 webdav
[root@server1 waimao.jiandanjie.com]# chmod 755 web -R
[root@server1 waimao.jiandanjie.com]#

Tags: ,
Nov 30
linux如何简单防止暴力破解
1、密码足够复杂
2、修改默认端口号
请问 ssh 客户端 和sshd 服务端区别
vim /etc/ssh/sshd_config  修改port 为 22
service sshd restart 重启服务

3、不使用root用户登录
/etc/passwd  其他用户(比如itlife365)改id为 0:0 ,则root用户不能登录,只能使用itlife365 用户,使用命令whoami 显示root

辅助方法:
查看端口号
nmap ip 
安装fail2ban可以监视你的系统日志

linux如何简单防止暴力破解的3种方法
how linux Prevent violence of three Method
Tags:
分页: 1/18 第一页 1 2 3 4 5 6 7 8 9 10 下页 最后页 [ 显示模式: 摘要 | 列表 ]