You are not logged in.

#1 2016-07-01 19:17:16

Registered: 2015-11-20
Posts: 7

Directory for SSH control sockets in $XDG_RUNTIME_DIR

Hello everyone!

I'd like to keep my SSH control sockets in a subdirectory under $XDG_RUNTIME_DIR. However, the subdirectory must be created on every boot in order to be used because of the $XDG_RUNTIME_DIR semantics.

I've been trying to find a way to create this directory automatically. tmpfiles.d seems like it could work but I don't want to hardcode my UID in there and I don't see any other way. I'd thought a systemd service file with a RuntimeDirectory option would work but found out it needs an Exec(Start|Stop) setting.

Does anybody have any ideas or suggestions as to how this could be done? And I'd also like to hear opinions on whether it makes sense to want to keep my control sockets in this directory. I usually see something like ~/.ssh/control recommended for this purpose but it doesn't make sense to me since a network socket shouldn't be persisted through boots.

Why doesn't something like a user-specific ~/.local/lib/tmpfiles.d exist?

On the other hand one can't use environment variables in ssh_config files, so something like "/run/user/<uid>/" has to be hardcoded in place of $XDG_RUNTIME_DIR. I don't like this.


Last edited by frangio (2016-07-09 03:16:54)


Board footer

Powered by FluxBB