Articles of centos

如何在Azure中交换VM磁盘?

我已经用azure重新创build了一个虚拟机,当我这样做的时候,azure给一个正常而明显的虚拟机分配了一个操作系统磁盘,而且我的虚拟机上有一个磁盘。 现在我在面板上有两个磁盘: – 操作系统磁盘 – 数据磁盘 我想要的是删除“当前操作系统磁盘”和设置数据磁盘作为操作系统磁盘是可能的?

在CentOS 7 x64上安装php-soap56w不工作

我按照这里的指南在CentOS 7上用Apache安装PHP 5.6。 一切顺利。 我现在需要安装PHP-SOAP,这给了我的依赖冲突。 所以我在这里使用这个指南来更新我的服务器存储库,包括webtatic,现在正在这样做: $ yum –assumeyes install php56w-soap Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * Webmin: download.webmin.com * base: centos.mirror.uber.com.au * epel: epel.mirror.digitalpacific.com.au * extras: centos.mirror.crucial.com.au * updates: centos.mirror.crucial.com.au * webtatic: us-east.repo.webtatic.com Resolving Dependencies –> Running transaction check —> Package php56w-soap.x86_64 0:5.6.2-1.w7 will be installed –> Processing Dependency: php56w-common(x86-64) […]

sftplogin问题与chroot

我希望能够创build一个托pipe多个网站的结构。 我希望用户文件驻留在/var/www/sites/domain.com内,并且使用chroot来限制sftp访问。 我已经遵循了一些关于如何设置的例子,这是我迄今为止所做的: 添加一个新用户,设置主目录和组: useradd foobar -d /var/www/sites/foobar.com -g sftp 在/etc/ssh/sshd_config我添加了: Match Group sftp X11Forwarding no ChrootDirectory %h AllowTcpForwarding no ForceCommand internal-sftp 并重新启动服务 我已经configuration/etc/vsftpd/vsftpd.conf以包含以下更改: anonymous_enable=NO local_enable=YES chroot_local_user=YES 并重新启动vsftpd 我将/ var / www / sites的所有权设置为root,将/var/www/sites/foobar.com设置为foobar 但是,当我尝试使用FileZilla通过SFTP连接我得到这个: Error: Authentication failed. Error: Critical error: Could not connect to server 给予filezilla的用户名​​和密码当然是正确的 我错过了什么?

makewhatis和logrotate cron工作时间表

在/etc/cron.daily/ , logrotate的* makewhatis.cron * 我明白上面是每日cron工作。 如何显示为logrotate和makewhatis.cron设置的时间? 它没有列出,当我尝试这个脚本: for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done

在CentOS 6上的sendmail&sasl auth

我将一个邮件服务器从一个CentOS 6移到另一个。 我用sasl pamauthentication使用sendmail。 当我尝试发送邮件时失败,因为用户没有通过身份validation,邮件客户端不需要密码。 新老服务器上的所有configuration文件都是相同的。 我用telnet(新服务器)testing了这个: # telnet localhost 25 Trying 127.0.0.1… Connected to localhost. Escape character is '^]'. 220 new.mldb.org ESMTP Sendmail 8.14.4/8.14.4; Wed, 4 Feb 2015 14:05:18 +0100 ehlo localhost 250-new.mldb.org Hello localhost.localdomain [127.0.0.1], pleased to meet you 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-8BITMIME 250-SIZE 250-DSN 250-ETRN 250-STARTTLS 250-DELIVERBY 250 HELP 旧服务器: Trying 127.0.0.1… Connected […]

在CentOS 6.6上使用sudo和–ask-sudo-pass

我正在运行命令: [[email protected] ]# ansible example.com -a "sudo id" –ask-sudo-pass sudo password: example.com | FAILED >> { "failed": true, "msg": "[sudo] password for kamil: \r\n{\"changed\": true, \"end\": \"2015-02-05 12:06:16.612869\", \"stdout\": \"\", \"cmd\": [\"sudo\", \"id\"], \"start\": \"2015-02-05 12:01:16.533325\", \"delta\": \"0:05:00.079544\", \"stderr\": \"\", \"rc\": 1, \"warnings\": []}\r\nOpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: Applying options […]

命令在bash脚本执行过程中失败

我正在做一个bash脚本来自动化一些常见的任务,但我有一些问题,我需要一些帮助。 这是我正在谈论的脚本: #!/usr/bin/env bash PS3='Please enter your choice: ' options=("Prepare environment" "Create new group" "Add users to group" "Change directory ownership" "Change directory permissions" "Quit") select opt in "${options[@]}" do case $opt in "Prepare environment") read -e -p "Enter the work directory: " -i "/var/www/html/" directory cd directory echo "Updating BOWER…" npm -g update bower […]

Apache:SSL和非SSL(没有VirtualHosts?)

我有一个Web服务器,并有两个文件夹,我想对待不同。 本地文件系统上的一个文件夹应该使用SSL,而另一个则不应该,例如: /path/to/ssl/site /path/to/nonssl/site 我已经查看了<Directory>参数,但不能在该级别禁用SSLEngine 。 [root@host /]# service httpd restart Stopping httpd: [ OK ] Starting httpd: Syntax error on line # of /some/config/file.conf: SSLEngine not allowed here 似乎使用<VirtualHost>给出了这种粒度,但我会使用相同的主机名,因此我有点困惑。 (匹配通配符*) # need to create a virtualhost for each Non-SSL folder? <VirtualHost *:80> SSLDisable … … </VirtualHost> # need to create a virtualhost for each […]

用apf设置fail2ban

与BFD一起,我们最近在服务器上安装了fail2ban,它是CentOS,它使用APF来阻止IP。 我已经在线寻找如何让两个工作,但是当一个IP被fail2ban阻止它不会出现在APF。 我已经手动改变了iptables-multiport.conf中的actionban指向apd而不是iptables,但它仍然不起作用。 jail.local [exim] enabled = true filter = exim logpath = /var/log/exim/mainlog action = iptables-multiport[name=exim,port="25,465,587"] sendmail-whois[name=exim, [email protected], [email protected], sendername="Fail2Ban"] #action = apf[name=eximfail2ban] # sendmail-whois[name=exim, [email protected], [email protected], sendername="Fail2Ban"] 有什么build议么?

Selinux“添加上下文规则到Semanage”

当您添加或更改新规则到fcontext semanage到任何目录并应用时,egg: # How to add this rule for apply changes whit restoreconf -Rv /var/www/html(/.*)?/media(/.*)? system_u:object_r:httpd_sys_rw_content_t:s0 # Here found all files have .bin and conf /etc/selinux/targeted/contexts/files 是否要应用的结果是使用平均httpd文件夹来写入和读取SELinux没有问题。 semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/domain.com/media #restorecon -Rv not apply changes