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

there is no way to query the ip of the connected client #2415

Open
yxzzx opened this issue Nov 7, 2022 · 3 comments
Open

there is no way to query the ip of the connected client #2415

yxzzx opened this issue Nov 7, 2022 · 3 comments

Comments

@yxzzx
Copy link

yxzzx commented Nov 7, 2022

In our environment we to know the ip address of the client doing the initial session setup.
Up to now we did use xtermals and deduced e.g. the name of the closest printer from the terminal name. After switching to xrdp and running xfreerdp on the clients (directly from rc.local) we no longer have access to this information and are forced to hard code such information in the users .profile.

It would be cool, if /etc/reconnectwm.sh would have access to the IP-address of the reconnecting client as well. In that case we could even update this information in a file in the user's homedirectory.

  • grepping in logfiles is clumsy (and the information isn't there anyway)
  • xrdp-sesadmin is unusable, because it requires authentication even when you just need information on your own session (and it doesn't provide the information anyway)

A very nice way would be something like
xrdb -get xrdp.clientipv4
xrdb -get xrdp.clientipv6
But I suspect Xorg.bin doesn't really know the ip of the connecting client or the xrdpdev_drv has no way to set a resource inside the server.

@yxzzx
Copy link
Author

yxzzx commented Nov 7, 2022

sorry, that issue should be in neutrinolabs/xrdp

@matt335672 matt335672 transferred this issue from neutrinolabs/xorgxrdp Nov 7, 2022
@matt335672
Copy link
Member

Hi @yxzzx

You're quite right - this information isn't currently available.

We've made recent changes which will aid this (#2251) These changes pass the connecting IP address from xrdp to xrdp-sesman.

From there it would be simple enough to set up an xrdb resource string as you suggest. Nice idea, by the way! It neatly sidesteps the problems with trying to do this via the environment.

A couple of provisos:-

  1. We can't backport the changes to the xrdp v0.9.x series, as there are too many dependencies.
  2. At the moment sesman is unaware of disconnections, so the client IP can be stale.
  3. The client IP will only be IPv4 or IPv6 - we can't know both.

I've got a PR in the pipeline which will make a login to xrdp-sesadmin unnecessary. My plan over time is to make this information available directly from xrdp-sesadmin, but we're a little way from that I'm afraid.

I can see your use-case clearly (I think), but I'd appreciate your comments on the above.

@yxzzx
Copy link
Author

yxzzx commented Nov 8, 2022

  1. I do not expect to get this with 0.9.x
  2. A stale client ip will not matter. We will take care of this in the reconnect script and when a user is disconnected, client dependent settings are not important (at least from my point of view).
  3. Bad thinking on my side, of course the client can be connected using ipv4 xor ipv6...

We need to modify /etc/xrdp/reconectwm.sh anyway, but I think it would be useful for others to have something like

if [ -x $HOME/.reconnectrdp ]; then
. $HOME/.reconnectrdp
fi

in it by default.

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

No branches or pull requests

2 participants