Articles of Debian

Postfix到Postfix中继

我有一个(可能不寻常的)使用Postfix将邮件转发到另一个Postfix邮件服务器,然后需要发送电子邮件的情况。 我已经阅读了大量的教程,并看到使用Postfix作为电子邮件中继发送给像Google这样的外部提供者的说明。这是不同的,因为我需要发送到另一个Postfix服务器,并使其作为发件人。 发件人总是相同的(对于两个服务器),但最终的收件人可以是任何人。 问题是我错过了一些重要的信息: 如何告知mail.postfix2.com接受来自postfix1.com的中继邮件? 如何告诉mail.postfix2.com将中继邮件发送到目的地? 如何更改mail.postfix2.com接受中继邮件的端口? 这里是基本的configuration参数: Postfix服务器1: main.cf: myhostname = postfix1.com relayhost = mail.postfix2.com mydestination = postfix1.com, localhost.postfix1.com, localhost, mail.postfix2.com inet_interfaces = all Postfix服务器2: main.cf: myhostname = mail.postfix2.com mydomain = postfix2.com mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain relay_domains = $mydestination inet_interfaces = all 当我尝试中继到mail.postfix2.com我得到: Oct 21 11:04:28 ns3312015 postfix / error [2538]:C016F47E75B5:to = […]

对Linux主机名,DNS主机名和FQDN主机名感到困惑

这对你们中的一些人听起来可能是愚蠢和基本的,但即使在网上阅读了大量的资料之后,我仍然对此感到困惑。 我的问题仍然不清楚: 机器中的主机名(例如,在debian OS ssh中键入hostname时)与您在DNS服务器A Record中键入的hostname不同? 将Debian机主机名设置为maximus并将DNS A Record Hostname设置为mail吗? 这两个是相同的,我觉得他们是混为一谈,或者他们通常用在互换的术语中,造成混乱? 对于FQDN, host部分是否使用机器的主机名或DNS Alogging中给出的主机名? 我的设置:1 Debian 7 VPS与Web服务器和邮件服务器都在同一个盒子上。

突然之间,关机命令再也找不到了

我login到我的Debian 7服务器,使用apt进行了升级,并想使用shutdown -r now关机+重启, shutdown -r now我做了很多次。 这一次,关机命令已经找不到了。 我已经阅读了一些地方,我可以尝试整个path/sbin/shutdown ,但程序也不在那里。 我也无法在任何地方find重新启动命令。 什么地方出了错? 我能做些什么来恢复关机命令?

gnupg'libgpg-error.so.0没有可用的版本信息'

我试图为Debian Wheezy编译gnupg-2.1.0,我已经下载并编译了所需的库( libgpg-error-1.17 , libgcrypt-1.6.2 , libksba-1.3.2 , libassuan-2.1.3和pth-2.0.7 ),通过./configure make install 。 然后,我将/usr/local/lib到/etc/ld.so.conf ,然后运行ldconfig以便gnupg可以find这些库。 Gpupg编译得很好,但试图运行./agent/gpg-agent或./g10/g我很抱歉这个错误: alpha@virtual:~/gnupg-2.1.0$ ./agent/gpg-agent –version ./agent/gpg-agent: /lib/i386-linux-gnu/libgpg-error.so.0: no version information available (required by ./agent/gpg-agent) ./agent/gpg-agent: /lib/i386-linux-gnu/libgpg-error.so.0: no version information available (required by /usr/local/lib/libgcrypt.so.20) ./agent/gpg-agent: relocation error: ./agent/gpg-agent: symbol gpgrt_set_alloc_func, version GPG_ERROR_1.0 not defined in file libgpg-error.so.0 with link time reference ldd […]

在Debian 7上设置通配邮件帐户进行转发

使用Debian 7我需要设置邮件服务器configuration用于testing目的。 这个设置并不是为了“进入生产”模式,而是在我们开发移动应用程序的过程中需要类似的东西。 该应用程序要求用户注册一个电子邮件地址,并发送一个确认链接,因为很多服务。 但是我们不能创build数百个真正的电子邮件地址进行testing,所以我们的想法是定义特定的通配符,任何匹配这个通配符的地址都应该被转发到特定的现有电子邮件地址。 例 user1_*@mydomain.com – > [email protected] user2_*@mydomain.com – > [email protected] 以便… [email protected] [email protected] [email protected] 都将被转发到[email protected]。 有没有任何教程或指导如何做到这一点?

使用cgroups作为用户来设置用户创build的systemd作用域的MemoryLimit

相关: 使subprocess的整体内存使用率 有没有一种方式让非特权用户或root用户允许非特权用户创build一个systemd作用域(或由systemdpipe理的其他控制组),以便该作用域的内存使用量是有限的,并且该限制可由用户? 或者,为什么这不能达到上述效果: $ systemd-run –scope –user –unit=limit-test.scope bash Running as unit limit-test.scope. $ systemctl show –user limit-test.scope |grep Mem MemoryAccounting=no MemoryLimit=18446744073709551615 $ systemctl set-property –user limit-test.scope MemoryAccounting=yes $ systemctl set-property –user limit-test.scope MemoryLimit=100M $ systemctl show –user limit-test.scope |grep Mem MemoryAccounting=yes MemoryLimit=104857600 $ python >>> a = [1]*1000000000 # happily eats 7.4G of […]

我可以用systemd重启依赖服务吗?

我已经创build了两个服务,一个用于rails应用程序,另一个用于其delayed_job进程,我想重新启动delayed_job服务,每次rails服务重新启动,我可以用systemd来做这个吗?

Bash脚本在debian上作为守护进程

我在bash中有一个简短的脚本,它需要在后台运行。 它基于inotifywait,它应该等待指定文件夹的更改,如果有任何更改,它应该运行复制过程。 #! /bin/sh case "$1" in start) dir=/var/www/www/source/ target=/var/www/www/htdocs/application/cache/target/ inotifywait -m "$dir" –format '%w%f' -e close_write | while read file; do cp "$file" "$target" done ;; stop) ;; esac 我已经把它放在/etc/init.d,保存后运行update-rc.d myscript默认 ,但是现在,当我尝试启动它时,会抛出服务启动命令,停止从inotifywait的消息中停止。 /etc/init.d/bash start Setting up watches. Watches established. 你可以给我一些提示如何在后台进程没有任何输出消息(在启动后立即以理想的方式)运行它?

DHCP不分配网关

所以我正在为KVM虚拟机运行一个开发服务器。 我有一个在主机节点上运行的本地DHCP服务器,具有以下configuration: 的/etc/dhcp/dhcpd.conf ddns-update-style none; default-lease-time 600; max-lease-time 7200; log-facility local7; option rfc3442-classless-static-routes code 121 = array of integer 8; option ms-classless-static-routes code 249 = array of integer 8; subnet xxx.xxx.x.0 netmask 255.255.255.0 { range xxx.xxx.x.2 xxx.xxx.x.127; option routers xxx.xxx.x.1; option broadcast-address xxx.xxx.x.255; option domain-name-servers 8.8.8.8; option netbios-name-servers 8.8.8.8; default-lease-time 86400; max-lease-time 86400; option rfc3442-classless-static-routes […]

安全傀儡添加系统用户到Debian

我想通过木偶添加一个系统用户到Debian框。 用户是: user { 'puppet': ensure => 'present', comment => 'puppetserver daemon', gid => '109', groups => ['www-data'], home => '/opt/puppetlabs/server/data/puppetserver', shell => '/bin/false', uid => '107', } (从puppetserver包创build的用户获得的uid和gid)。 我可以相信,其他服务还没有在某些盒子上使用107吗? Debian上有没有safe uid ? 它是如何工作在Debian的系统用户的uid分配?