Closed andyzasl closed 5 years ago
:+1: never came across this use case, but now that I see it seems only natural to have it.
Should I create pull request?
I think so, in my opinion this is a very clear, useful, concise feature, and I'm sure @dvddarias will accept it.
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.
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.
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.