我有两个服务器,一个在Amazon实例(t1.media)中,另一个在Microsoft (媒体)实例中。这两台服务器具有相同的配置Ubuntu LTS 12.04.1, 64-bit arch,运行PostgreSQL 9.1。我需要在Azure上设置灾难恢复系统(为亚马逊实例的数据库打开WAL存档,用于通过pgbarman进行特定的数据备份计划)。
在通过pgbarman博士的过程中,强制要求之一就是,
ssh通信。(Pgbarman有一个先决条件,让postgres@amazon直接到barman@azure,反之亦然.)看,从Pgbarman开始)。但是,我记录这些实例的复杂性如下:
.pem文件,无需任何密码验证即可访问该文件:ssh -i my-pem-file.pem ubuntu@my-instance-public-ip-region.compute.amazonaws.com.pem文件。相反,可以使用密码机制( ssh azure-user@app.cloudapp.net )访问它。不过,为了启用我所做的设置,
postgres-barman.pub的ssh-keygen创建了一个密钥文件barman@azure。ssh-copy-id -i ubuntu@amazon将此文件传输到亚马逊(有关更多信息,请参见下面的链接)我的问题是:
- I cannot transfer this file to `postgres` user: `cat postgres-barman.pub | ssh -i my-pem-file.pem postgres@amazon 'cat >> .ssh/authorized_keys'` but if I change destination's user to `ubuntu`, the file gets copied.
- After transferring the file (via `ubuntu` user), I try to do this: `ssh postgres@amazon`. It fails.
- The same file is now residing on both sides. Still, if I issue `ssh barman@azure`, it asks for a password authentication (which is set to `yes` in `/etc/ssh/sshd_config` of the Azure instance). I cannot proceed with this die to `barman` pre-req.
ssh用户进行ubuntu编辑。我需要为postgres用户启用此功能。这能办到吗?注意:亚马逊在其PasswordAuthentication文件中将no设置为no。
参考文献:
发布于 2014-02-11 08:16:09
不管怎么说,我已经解决了。
我没有正确地做配置。我就是这么做的。
在亚马逊:
ubuntu@amazon~$ sudo -s
root@amazon~$ passwd postgres
Enter new UNIX Password:
ubuntu@amazon~$ su - postgres
Password:
postgres@amazon~$ ssh-keygen -t rsa
postgres@amazon~$ scp .ssh/id_rsa.pub barman@azure-ip:~/.ssh/在蔚蓝上:
ubuntu@azure~$ sudo -s
root@azure~$ passwd barman
Enter new UNIX Password:
ubuntu@azure~$ su - barman
Password:
barman@azure~$ cd .ssh
barman@azure~$ cat .ssh/id_rsa.pub >>~/.ssh/authorized_keys现在,ssh到蔚蓝:
postgres@amazon:~$ ssh barman@azure现在,对Azure重复同样的话。
唯一的区别是,关键转移到亚马逊并没有发生通过scp。因此,我在barman@azure的/.ssh文件夹中复制了/.ssh中的内容,粘贴在postgres@amazon的.ssh/authorized_keys文件中并保存了它。
现在,ssh转到amazon:
barman@azure:~$ ssh postgres@amazon它起作用了!谢谢你的建议!
参考文献:
现在要担心酒保的事了。
https://stackoverflow.com/questions/21672696
复制相似问题