Creating remote user to launch one file

0

Here is the problem: I have made something with python that works with virtually any OS, except windows, and I have been told the people who are going to evaluate/use/try it only have windows available. All available console emulators have failed, and I don't have the option to rewrite the code or install a virtual machine in those machines.

The deadline is in 8 hours and this is what I have in mind:

Take my server, create a passwordless user (with, for example, the app name) that can only launch that file or an alias (that launches the file) and start the ssh server.

Then all they have to do is ssh into the machine and the program pops up. It's a text-only console thing, so there can't be issues with that.

The thing is, I don't know how to make a linux user THAT limited. How can I do that? The server is just a test machine, it does not hold important data and it's normally turned off or working offline, so security is not a big issue here. I just want to get this working. Also the solution is not going to be permanent, I just need it to work tomorrow for ~7 hours and then I'll be able to fiddle freely with it and get it working properly.

Edit: As much as I appreciate lenghty answers full of info I have to tell it's 4:30AM, I have been up for almost two days and I'm about to pass out over my keyboard. So please, don't add anything that is not essential, I couldn't possibly process that.

Achifaifa

Posted 2014-07-26T02:24:32.817

Reputation: 238

Answers

0

I could not create a passwordless user, but I created one with username and password programname and in the /etc/ssh/sshd_config file I added Match User testuserand ForceCommand python /path/file.py That way anyone can log in (the login info is in the web site at that server) see the program and then log out automatically when the program closes.

Achifaifa

Posted 2014-07-26T02:24:32.817

Reputation: 238

0

You can allow passwordless logins through SSH authorization keys running ssh-keygen, which generated a public and private key. The user needs the private key to login and server needs the public key in ~/.ssh/authorized_keys You can get more info on How to set up ssh so you aren't asked for a password

About the restriction, you can create a chrooted environment for this user, which is more secure but takes much more work to do, or you can make few restrictions on authorized keys:

command="/your/script/path/filename",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pry YOUR-SSH-KEY

You can get more info on Managing SSH for Scripts and cron Jobs

denisvm

Posted 2014-07-26T02:24:32.817

Reputation: 604