Skip to content

Commit

Permalink
fix(rootfs): ssh auth invalid when container user not is root (#65)
Browse files Browse the repository at this point in the history
By default, when the socket file mounted by the virtual machine is mounted to the container, the 'other' permission of the socket file is non-write. This will result in the lack of permission for non-root container users to send messages to the socket.

Signed-off-by: Kevin Cui <bh@bugs.cc>
  • Loading branch information
BlackHole1 committed Apr 10, 2024
1 parent 80fdf81 commit e8b4b9f
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Restart=always
ExecStartPre=/bin/mkdir -p /opt/ovm
ExecStartPre=/bin/rm -f /opt/ovm/ssh-auth.sock
ExecStart=socat UNIX-LISTEN:/opt/ovm/ssh-auth.sock,fork VSOCK-CONNECT:2:1028
ExecStartPost=/bin/bash -c "while [ ! -e /opt/ovm/ssh-auth.sock ]; do sleep 0.1; done; /usr/bin/chmod a+rw /opt/ovm/ssh-auth.sock"

[Install]
WantedBy=default.target

0 comments on commit e8b4b9f

Please sign in to comment.