dvddarias / rdocker

Securely control a remote docker daemon CLI using ssh forwarding, no SSL setup needed.
MIT License
112 stars 17 forks source link

Multi user problem #10

Closed andyzasl closed 5 years ago

andyzasl commented 7 years ago

For example we have 1 docker host, and 2 users, both want to use rdocker. when 1st come to host - script will create a /tmp/rdocker-forwarder.py with user1 permissions. (644 in my case) then 2nd, takes permission denied while trying to overwrite it.

My fix is to inject username to /tmp/rdocker-$USER-forwarder.py name.

apiad commented 7 years ago

:+1: never came across this use case, but now that I see it seems only natural to have it.

andyzasl commented 7 years ago

Should I create pull request?

apiad commented 7 years ago

I think so, in my opinion this is a very clear, useful, concise feature, and I'm sure @dvddarias will accept it.

dvddarias commented 7 years ago

Included the remote port number in the forwarder script name: /tmp/rdocker-$remote_port-forwarder.py Now the name is unique per connection, this should solve the multi user problem. @andyzasl check it out and tell me if it works.

andyzasl commented 7 years ago

I believe it works ;) but port info in injected into script at run time, so, I suppose to use $USER to find who is there :)

Btw, I think this will not fix problem if two same-name-users will connect, so maybe, the $USER-$remote_port is better.