Skip to content

A bot that opens an SFTP request and generate a unique username and password for each email.

Notifications You must be signed in to change notification settings

ziadkiwan/SFTP_Email_Bot

Repository files navigation

SFTP_Email_Bot

A bot that manage an SFTP server connections by email commands.

To trigger the bot you need to send an email to the email you specify in the script containing a keyword by default its "DATA" the bot will generate a unique username and password and email back them to you, the server default session time is 1 hour after it expires it will close the connection,if another request is sent while the server have an opened session, the server will notify the sender that it's busy when the server is done from the first session it will automatically opens up a session for the second one.

Required Libraries:

smtplib
paramico

the server uses mysqldb to store the opened sessions, requested sessions.
Python 2.7 is used.

Configuration Steps:

mail-recieve.py:
add the lisetning email, at the top of the script you change the variables below:
youremail = "EMAILHERE"
yourpassword = "PASSWORDHERE"
if you want to change the keyword change the variable below:
keyword = "DATA"
sendemail.py:
add the email that the bot should use to send notifications, at the top of the script you change the variables below:
youremail = "EMAILHERE"
yourpassword = "PASSWORDHERE"
dbconnector.py:
you should edit the connection strings specify your server address and the username and password.
 return MySQLdb.connect(host="localhost",    # your host, usually localhost
                     user="root",         # your username
                     passwd="password",  # your password
                     db="sftp") 
Mysql DB Configuration
use createdatabase.sql to create the DB.

launch the bot:

python mail-receive.py

About

A bot that opens an SFTP request and generate a unique username and password for each email.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages