resolve issues with missing user in containers

This change resolves an issue in container where the user id is not found.

This will create a passwd file with a single line that is for the container user using the uid and gid of the pterodactyl user.

As an added security benefit this would also stop users being able to just use `/bin/bash` as it sets the users terminal to nologin by default and is configurable

example passwd file contents  
`container:x:999:999::/home/container:/usr/sbin/nologin`
This commit is contained in:
Michael Parker
2023-08-12 17:26:23 -04:00
parent 438e5fdbe9
commit 49b00fc48a
2 changed files with 26 additions and 0 deletions

View File

@@ -27,6 +27,12 @@ func (s *Server) Mounts() []environment.Mount {
Source: s.Filesystem().Path(),
ReadOnly: false,
},
{
Default: true,
Target: "/etc/passwd",
Source: "/etc/pterodactyl/passwd",
ReadOnly: true,
},
}
// Also include any of this server's custom mounts when returning them.