OpenVZ Forum


Home » General » Support » Share /etc/passwd among VEs
Share /etc/passwd among VEs [message #29489] Tue, 15 April 2008 09:47
heruan is currently offline  heruan
Messages: 17
Registered: February 2007
Junior Member
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

 
Read Message
Previous Topic: Porting old server inside VE
Next Topic: iptables error 18446744073709551615 on hardware node
Goto Forum:
  


Current Time: Sun Jul 14 08:01:50 GMT 2024

Total time taken to generate the page: 0.02248 seconds