I want to share system users and groups among VEs, so I created a directory /vz/share/etc/ e copied /etc/passwd, /etc/group, /etc/shadow and /etc/gshadow. Then I created /etc/vz/conf/100.mount:
#!/bin/bash
/bin/mount --bind -n /vz/share/etc/passwd /vz/root/$VEID/etc/passwd
/bin/mount --bind -n /vz/share/etc/group /vz/root/$VEID/etc/group
/bin/mount --bind -n /vz/share/etc/shadow /vz/root/$VEID/etc/shadow
/bin/mount --bind -n /vz/share/etc/gshadow /vz/root/$VEID/etc/gshadow
exit $?
But when I try to add a user inside the VE:
# useradd testuser
useradd: cannot rewrite password
because it tries to unlink /etc/passwd to replace it with the new one, but /etc/passwd is actually a mounted file so it cannot be deleted. I don't want to mount the entire /etc directory and so I can't figure out how to share system users...
[Updated on: Tue, 15 April 2008 09:58]
Report message to a moderator