This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

sshd user switching (keywords: whoami sshd_server public-key host-based)

I've looked through the mailing list and I've seen some discussion about this, but most of the threads were pretty old and none of them really addressed the exact problem I'm seeing.  I have sshd up and running on a Windows 2003 server with public-key auth working.  The setup was smooth as silk and completely painless.  Very impressive, the maintainers should be quite proud.  So the only snag I have left is that when I try to kick off a script/program via an ssh "one-liner" the authentication doesn't work the way I expect.  If I log in to a shell "whoami" returns to correct answer.  If I "ssh user@server whoami", I get the sshd_server user:

[root@dosas ~]# ssh
Last login: Wed Aug 22 20:14:51 2007 from
You are successfully logged in to this server!!!

ADAdministrator@kazzak ~
$ whoami

ADAdministrator@kazzak ~
$ logout
Connection to closed.
[root@dosas ~]# ssh whoami

I am making an educated guess here in that the former instance the sshd_server is kicking off the user's shell as the user (that's where Privilege Escalation comes into play?), but in the latter case it just executes the script/program directly.  If so, doesn't this represent a pretty serious security problem (ie. any user could run any program as the sshd_server user)?  If this isn't a default security problem and is merely a configuration issue, does anyone have any suggestions as to how to fix it?  Or if I'm stuck with this, are there any clever workarounds?  Thanks in advance for the help.


Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]