su - root command inside of container results into a following error:
# vzctl enter 100 entered into Container 100 CT-100-bash-4.1# su - root : No such file or directory
No such file or directory indicates that
/etc/passwd file is malformed. It is necessary to check that record for
root user is correct.
Content even might look fine if printed on a screen:
CT-100-bash-4.1# grep ^root /etc/passwd root:x:0:0:root:/root:/bin/bash
vi utility displays
^M symbol in the end of line(s). E.g.:
This issue takes place because
/etc/passwd file was edited on a Microsoft Windows environment.
You can also verify
/etc/passwd file using
# cat /etc/passwd | grep ^root | hexdump -c 0000000 r o o t : x : 0 : 0 : r o o t : 0000010 / r o o t : / b i n / b a s h \n 0000020
Incorrect example (file was edited in Windows):
# cat /etc/passwd | grep ^root | hexdump -c 0000000 r o o t : x : 0 : 0 : r o o t : 0000010 / r o o t : / b i n / b a s h \r 0000020 \n 0000021
/etc/passwd is correct and doesn't contain bogus symbols. Remove them with
vi utility or recover the file from a backup if it is severely damaged.