Articles of centos6

SELinux允许启用; httpd错误报告

我一直在apache / var / log / messages和其他许多相同的消息得到以下通知: kernel: type=1400 audit(1422862414.790:3222): avc: denied { getattr } for pid=2484 comm="deliver" path="/var/panel/sieve/globalfilter.sieve" dev=dm-0 ino=659172 scontext=system_u:system_r:dovecot_deliver_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=lnk_file Kernel : type=1400 audit(1422862549.898:3244): avc: denied { getattr } for pid=2320 comm="httpd" path="/var/panel/hostdata/admin/public_html/Mywebsite_com$$ai_com/admin/ajax.php" dev=dm-0 ino=5625763 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:var_t:s0 tclass=file kernel: type=1400 audit(1422862414.813:3229): avc: denied { lock } for pid=2484 comm="deliver" path="/var/panel/vmail/website.com/fail2ban/dovecot.index" index" […]

mysql密码中使用mysqldump的特殊字符

我有以下的SSH脚本: #Here I am getting the mysql password for the root user password=$(cat /root/.my.cnf | grep "password" | awk -F\" '{print $2}') #here I am trying to dump the database remotely mysqldump -uroot -p$password $db | ssh root@$destination_server "cat > /backup/mysql/$db.sql" 问题是,我收到以下错误: /bin/bash: -c: line 0: syntax error near unexpected token `)' /bin/bash: -c: line […]

SSH超时问题不一致

我不确定是否有其他人有SSH超时的问题 我安装了一个CentOS 6.5最低限度的安装,而不用接触SSH congfig,当我通过使用putty的SSHlogin时,它永远不会超时。 我可以持续几个星期,即使闲置也不会超时 我安装了另一个新的insatll,没有触摸sshconfiguration,它每隔2分钟左右就超时 我的意思是为什么这样呢? SSH是否像硬币抛弃一样,对于某些服务器来说,比起其他服务器而言,即使使用相同的确切configuration,它也可能会更频繁地超时 任何人都经历过这个? 无论如何,我继续前进,并添加 ClientAliveInterval 60 在服务器上,仍然得到超时问题 有人可以告诉我如何有一个CONSISTENT sshconfiguration,将完全禁用超时..这将100%的时间,如预期的那样工作? 谢谢

使用单行命令获取linux进程的实时CPU使用情况,并且获得简单的结果

我到处search,一无所获。 我正在尝试创build一个显示由PID指定的一个进程的CPU使用情况的小规格。 我需要命令来打印一个简单的答案,所以为什么top -p $ pid不好。 该命令由PHP执行,需要立即打印响应。 与我需要的东西密切相关的东西是 sudo ps -p $pid -o %cpu 但经过testing和search一些更多,我发现这打印的过程开始以来的平均使用量。 我需要从命令运行的那一刻起的实时使用,就像上面显示的一样。 这可能吗? 编辑:: $cmd = 'sudo sh -c "top -n1 | awk \'/30100/ {print $9}\'"'; echo exec($cmd); 尝试没有壳 $cmd = "sudo top -n1 | awk '/30100/ {print $9}'"; echo exec($cmd); 仍然没有结果,它不回应任何东西

TSC缺less可用的时钟源

不确定为什么TSC作为时钟源不可用? cat /sys/devices/system/clocksource/clocksource0/available_clocksource hpet acpi_pm 我使用的CPU是Intel Xeon(R) X5570 @ 2.93GHz 。 主板是Supermicro X8DTU-F 。 运行CentOS 6.3 2.6.32-279.22.1.el6.x86_64 。 对使用以下程序测量的hpet或acpi_pm的性能hpet 。 #include <time.h> main() { int rc; long i; struct timespec ts; for(i=0; i<10000000; i++) { rc = clock_gettime(CLOCK_MONOTONIC, &ts); } } 用hpet作为时钟源 time ./clock_timing real 6m25.761s user 6m23.456s sys 0m0.403s 以acpi_pm作为时钟源 time ./clock_timing real 10m12.057s […]

任何与CentOS 6.6 KVM(Centos)Guest上安装的vmtools相同?

在ESX中创buildLinux VM时,我通常会使用vSphere Client标记虚拟机以安装vmtools。 vmtools保存在服务器上,安装在虚拟机下次启动时,并允许从vSphere Client界面正常closures或重新引导虚拟机(以及其他优点)。 在一个新的Centos 6.6服务器上,我已经安装了qemu-guest-agent和qemu-kvm-tools,这些工具将涵盖所有的东西。 但是从virt-manager界面,我不能closures一个虚拟机(gui中的这个选项没有任何作用),我没有看到虚拟机“详细信息”下的任何工具安装选项的提及。 我将来会和virsh一起工作,但假设我也需要像vmtools这样的东西,如果我想正常closures一个虚拟机。 感谢您的任何意见….莱尔

如何在Web浏览器中限制samba共享文件访问?

我已经configuration了samba来共享这些文件。但是我想限制这些共享文件显示,除了网页浏览器中的授权用户。 例如: 我的smb.conf文件是 [Creative] printable = no writable = yes path = /mnt/project/Creative write list = +staff Comment = Creative valid users = creative, admin 我不想显示这个“创意”的文件夹,除了我的networking浏览器中的有效用户。怎么做?

无法在Google计算机之间设置无密码的ssh

我正在尝试在谷歌计算centos 6实例之间设置无密码的ssh。 我将服务器1的公共复制到serer-2的'.ssh / authorized_keys'。 我确保.ssh文件夹和authorized_keys的所有权限都是正确的。 当我尝试ssh时,它给予权限被拒绝。 Permission denied (publickey,gssapi-keyex,gssapi-with-mic). 这是带有详细标志的stdout。 OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to server-2 [:D:D.:D:D:D.:D:D:D.:DD] port 22. debug1: Connection established. debug1: permanently_set_uid: 0/0 debug1: identity file /root/.ssh/identity type -1 debug1: identity file /root/.ssh/identity-cert type […]

auditd进程在logrotate脚本运行后停止日志logging

我正在尝试使用logrotate将审计日志保留一段时间,而不是使用auditd的特殊轮询(从/etc/audit/auditd.conf )。 我已经将该文件中的max_log_file_action更改为IGNORE 。 以下是我的logrotateconfiguration: /var/log/audit/audit.log { daily dateext rotate 180 postrotate /bin/kill -HUP `cat /var/run/auditd.pid 2> /dev/null` 2> /dev/null || true endscript } 日志成功旋转。 但是,审计守护进程不会再次开始logging。 /var/log/audit/audit.log保持为空,直到我重新启动审计服务。 我也试过/bin/kill -USR1和service auditd reload /bin/kill -USR1 service auditd reload ,但是这些选项也不能正常工作。 /bin/kill -USR1实际上保持了审计守护进程的运行,但它创build了一个空的audit.log.1文件。 有没有办法成功地发送信号到审计守护进程,以保持它在logrotate之后运行? 谢谢。

在ImageMagick更新中的yum依赖冲突

我使用php5.5在CentOS release 6.6 (Final)上运行Lamp服务器: $ php -v PHP 5.5.17 (cli) (built: Sep 20 2014 17:12:00) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies with Xdebug v2.2.5, Copyright (c) 2002-2014, by Derick Rethans 当我运行yum update我得到这个依赖性错误: Loaded plugins: fastestmirror Setting up […]