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

Is this able to utilize my ssh config? #97

Open
nhed opened this issue Oct 17, 2019 · 7 comments
Open

Is this able to utilize my ssh config? #97

nhed opened this issue Oct 17, 2019 · 7 comments
Labels

Comments

@nhed
Copy link

nhed commented Oct 17, 2019

Fedora 30
Trying to utilize a working entry in my ssh config and getting final secrets request failed to provide sufficient secrets I set to use ssh agent but the underlying ssh processes is never executed

I was going to debug assuming ssh is launched then fails - but straced from a wrapper to /usr/libexec/nm-ssh-service and the only exe* calls were

24214 <... execve resumed>)             = 0
24214 execve("/sbin/modprobe", ["/sbin/modprobe", "tun"], 0x562786cb69e0 /* 10 vars */) = -1 EPERM (Operation not permitted)

if you dont actually execute ssh, how can you know that there are secrets missing?

@nhed
Copy link
Author

nhed commented Oct 17, 2019

and yeah, I was assuming I would need to deal with ssh launched as root - but figured I would deal with those details once I saw how ssh is launched

@danfruehauf
Copy link
Owner

Interesting that you ask about it now. This behaviour can lead to privilege escalation quite easily. The reason for that is that the plugin runs as root, yet your config can be modified by you and you can specify arbitrary commands to run in it. This is... undesirable. I'm still thinking of a good solution for that, but at the moment, I would recommend to not allow that.

What do you think?

@nhed
Copy link
Author

nhed commented Feb 17, 2020 via email

@nhed
Copy link
Author

nhed commented Feb 17, 2020

it's been a while since I actually asked, but if your main process runs as root you can run the ssh process itself as the user.  in which case the risk exist only if the user specified that the connection is to be shared with other users (which you should warn them not to do, maybe even prevent if you can...  I'm not that familiar with the innards of network manager, but I an a heavy ssh user and just won't use anything that can't utilize my extensive configs)

if this is coming out multiple times blame the github android app

@danfruehauf
Copy link
Owner

in which case the risk exist only if the user specified that the connection is to be shared with other users (which you should warn them not to do, maybe even prevent if you can...

That would be quite difficult to do. I don't think nm will really allow me to intervene with things in that level, as a plugin maintainer.

but if your main process runs as root you can run the ssh process itself as the user.

That is a problem, as you need root privleges (or at least CAP_NET_ADMIN) to open new network devices (tun/tap), hence, it needs to run privileged. I tried to play with capabilities and perhaps just leave CAP_NET_ADMIN and run as a regular user (reduce privileges), but that didn't work out very well, so I had to remove the feature of "free hand" options altogether...

@ChristofKaufmann
Copy link

So this is also an issue for me. I try to connect to a remote machine via a jump host, like my-local-machinejump-hostremote, and cannot see, how I can set it up.

When using ssh remote-machine as root user the ssh command reads /root/.ssh/config, searches for the Host remote-machine and finds the ProxyJump jump-host option. However, the NM SSH VPN plugin seems only to look for Host * and not for remote-machine. This is also the case for files in /etc/ssh/ssh_conif.d/. Is this a bug?

An alternative would be to use ssh machine -J jump-host, but this cannot be specified, since extra ssh options have been removed in #98.

@danfruehauf danfruehauf added the bug label Sep 6, 2021
@danfruehauf
Copy link
Owner

I'd classify it as a bug, yes. Unfortunately I've been hammered with life and work recently, and have very little time to get to nm-ssh 😢

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

No branches or pull requests

3 participants