Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set group ownership of unix socket #508

Open
bryfry opened this issue Oct 17, 2020 · 2 comments
Open

Set group ownership of unix socket #508

bryfry opened this issue Oct 17, 2020 · 2 comments

Comments

@bryfry
Copy link

bryfry commented Oct 17, 2020

Is your feature request related to a problem? Please describe.
I have a command that I want to run as root wrapped up by ttyd but I'd like nginx user (www-data) to be able to access the unix socket created by ttyd.

Describe the solution you'd like
This would be made possible by allowing the permissions (owner:group) for the newly created ttyd socket file.

Describe alternatives you've considered
I've worked around this issue by modifying the permissions of the socket after it comes online.

Additional context
I'm a huge fan of the unix socket interface. This was only a minor inconvenience in an otherwise awesome experience getting ttyd setup to accomplish my project needs.

@tsl0922
Copy link
Owner

tsl0922 commented Nov 7, 2020

The underlying websocket feature (and unix socket) is based on libwebsockets, so if libwebsocket support it (didn't check yet), I'm OK to add it to ttyd.

@cRoCx
Copy link

cRoCx commented Jan 4, 2024

I had the same or similar issue and solved it by having ttyd executed as user exampleuser and group www-data through a systemd service.
An example of this service can be found in the wiki here.
Instead of Group=root you could use Group=www-data.
When ttyd is called with -i /tmp/ttyd.sock the socket file with have rw permissions for user exampleuser and group www-data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants