Can I hardlink config files?

16 views
Skip to first unread message

Dennis Kaplan

unread,
Jul 27, 2012, 7:42:18 PM7/27/12
to linux-co...@googlegroups.com

I have this idea to ease administration of my lxc virtual boxes by hard linking some of the configurations files, like sshd, fail2ban etc. I am the only one with root access to the boxes!

  • Will the files only change if I change them in the physical server, or can they be modified from every virtual box? I am thinking that I will be able to modify them from any of the servers.
  • Are there any other implications I am not thinking of?
  • I am guessing soft links ln -s won't work?
  • Does the command below look okay?

From the physical server:

rm /var/lib/lxc/vm0/rootfs/etc/ssh/sshd_config
rm
/var/lib/lxc/vm1/rootfs/etc/ssh/sshd_config
rm
/var/lib/lxc/vm2/rootfs/etc/ssh/sshd_config
rm
/var/lib/lxc/vm3/rootfs/etc/ssh/sshd_config
ln
-p  /etc/ssh/sshd_config /var/lib/lxc/vm0/rootfs/etc/ssh/sshd_config
ln
-p  /etc/ssh/sshd_config /var/lib/lxc/vm1/rootfs/etc/ssh/sshd_config
ln
-p  /etc/ssh/sshd_config /var/lib/lxc/vm2/rootfs/etc/ssh/sshd_config
ln
-p  /etc/ssh/sshd_config /var/lib/lxc/vm3/rootfs/etc/ssh/sshd_config



Reply all
Reply to author
Forward
0 new messages