Skip to content

Commit d0a5d5d

Browse files
gwenyastgraber
authored andcommitted
incusd/instance/lxc: Allow unprivileged users in application containers to bind to all ports
Signed-off-by: Gwendolyn <[email protected]>
1 parent 3d12d99 commit d0a5d5d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/server/instance/drivers/driver_lxc.go

+6
Original file line numberDiff line numberDiff line change
@@ -2328,6 +2328,12 @@ func (d *lxc) startCommon() (string, []func() error, error) {
23282328
return "", nil, err
23292329
}
23302330

2331+
// Allow unprivileged users to use low ports.
2332+
err = lxcSetConfigItem(cc, "lxc.sysctl.net.ipv4.ip_unprivileged_port_start", "0")
2333+
if err != nil {
2334+
return "", nil, err
2335+
}
2336+
23312337
// Configure the entry point.
23322338
if len(config.Process.Args) > 0 && slices.Contains([]string{"/init", "/sbin/init", "/s6-init"}, config.Process.Args[0]) {
23332339
// For regular init systems, call them directly as PID1.

0 commit comments

Comments
 (0)