cmake . -DLUA_INCLUDE_DIR=/usr/local/include/ -DLUA_LIBRARY=/usr/local/lib/liblua.
Read More →
# 查询文件属于哪个安装包 $ rpm -qf /usr/bin/ldd # 查询某个目录、文件、模块是由哪个包提供 $ rpm -q --whatprovides /usr/bin # 查询被哪个包需要 $ rpm -q --whatrequires /usr/bin/lynx # 查询包中文件 $ rpm -qpl filename # 查询已安装文件 $ rpm -ql name # 查询配置文件 $ rpm -qpc filename $ rpm -qc name # 查询所有信息 $ rpm -qpil filename $ rpm -qil name
$ yum list name 可以看包版本 $ yum provides libselinux.so.1 libselinux-2.0.94-5.3.el6.i686 : SELinux library and simple utilities Repo : local Matched from: Other : libselinux.
Read More →
readelf -s filename nm filename |grep xxx
#!/bin/sh if [ $# -lt 1 ] then echo Usage:xx exit 1 fi NAME=$1 echo $1 PID=`ps -ef|grep $NAME$ |grep -v $0 |awk '{print $2}'` echo $PID kill -9 $PID echo killed
1.ulimit -c unlimited 2./proc/sys/kernel/core_pattern 2.或者/etc/sysctl.conf中添加kernel.core_pattern=core_%e_%p或sysctl -w kernel.core_pattern=core_%e_%p 3.查看/etc/security/limits.conf * soft core unlimited //所有用户 <user-login-id> soft core unlimited //设置某个用户 还有hard core需要考虑$sysctl -a|grep core_pattern kernel.core_pattern = |/usr/libexec/abrt-hook-ccpp /var/cache/abrt %p %s %u %c
“abrtd” creates a sub-directory (named something like “ccpp-1279914365-14618”) in the directory “/var/cache/abrt” as shown in the value of the variable. This also means that the core files will also be stored in that sub-directory in the “/var/cache/abrt” directory (in addition to the current directory where application was run).
Read More →
1. Pam_Tally2解锁SSH登录失败锁定 路径: /etc/pam.d/password-auth,/etc/pam.d/system-auth A pluggable authentication module (PAM) is a mechanism to integrate multiple low-level authentication schemes into a high-level application programming interface (API) Example: auth required pam_tally2.so deny=4 even_deny_root unlock_time=1200 deny 指定最大几次认证错误,如果超出此错误,将执行后面的策略。如锁定N秒,如果后面没有其他策略指定时,默认永远锁定,除非手动解锁
lock_time 锁定多长时间,按秒为单位
unlock_time 指定认证被锁后,多长时间自动解锁用户
even_deny_root root用户在认证出错时,一样被锁定
2. 查看状态与解锁 pam_tally2 --user oracle pam_tally2 --user oracle --reset 3. Linux锁定账号 禁止个别用户登录(su可切换)
passwd -l test passwd -u test 修改shell类型禁止登录(su切换不可)
cat /etc/passwd |grep zx 锁定: sed -i 's#/home/zx:/bin/bash#/home/zx:/sbin/nologin#g' /etc/passwd 等价于: usermod zx -s /sbin/nologin 解锁: sed -i 's#/home/zx:/sbin/nologin#/home/zx:/bin/bash#g' /etc/passwd 等价于: usermod zx -s /bin/bash 禁止其他用户登录(su可切换)
Read More →