in reply to Re^2: SSH daemon in Perl?
in thread SSH daemon in Perl?

Hi robs87,

How can I make the OpenSSH server execute this program upon connection without creating any user accounts?

What's stopping you from setting up a new user? One more thing to consider, in your suggested scenario, whose user permissions is the script supposed to run with - I'm guessing not sshd's permissions (often root)?

I don't know about Net::SSH::Perl::Subsystem::Server, but nothing is stopping you from trying it out :-) (The documentation does mention its API is in alpha.)

Regards,
-- Hauke D

Replies are listed 'Best First'.
Re^4: SSH daemon in Perl?
by robs87 (Novice) on Jun 22, 2016 at 23:07 UTC

    It wouldn't be practical to create a user account on the server for each user. Plus, doing so would lead to quite a few security concerns. Authentication will be handled by the Perl program. Perhaps OpenSSH can be configured to pass the username and password to the Perl program as arguments?

    I'd rather not execute the Perl program as root. Perhaps OpenSSH has an option to execute it as a different user?

      Hi robs87,

      You haven't explained why you need this kind of SSH connection like you described here. Doing so would help in that maybe there is an easier solution to the problem you're trying to solve. For example, have you considered something like telnet+SSL?

      I haven't worked much with OpenSSH so this is just an educated guess, but you might want to look into PAM (pluggable authentication modules), I believe OpenSSH can be configured to use custom PAM modules which might give you the ability to have OpenSSH authenticate with something other than UNIX accounts.

      Hope this helps,
      -- Hauke D