Inspiration

Inspired by our teammate Ian's previous experience with sending text messages over an email server, we decided that it would be extremely useful to be able to do more with text messages. In addition, it's often necessary to manage a server on the go, and given that text messages don't require a Wi-Fi connection, they're the perfect way to make sure that we could have access to our server 24/7.

What it does

Our python project listens for a text message (through a dedicated SMTP email server) then reads and parses the email to get a bash command. Then it creates a subprocess to run the bash command on the server's shell. It also includes two factor authentication, with a config file and a required usage password.

How I built it

We wrote 3 python scripts and used an IMAP library to create a running Python daemon to listen for bash commands.

Challenges I ran into

It was difficult to change directory, since processes terminated after a single command, but we decided to store the directory and track changes. Error handling with incorrect commands was also difficult, since error messages have different formatting.

Accomplishments that I'm proud of

The python script is extremely fast, and took relatively little code to write, given the fact that it can run almost any one line bash command.

What I learned

We learned how to spawn subprocesses, route text messages through email, and in general, how to use python's massive standard library to accomplish tasks far more difficult with other languages.

What's next for SSH over SMS

The next step is support two line commands and commands that require interaction, such as "sudo". In the future, we'd like to make it possible to conduct even more complex operations over text.

Built With

+ 26 more
Share this project:
×

Updates