Link to home
Start Free TrialLog in
Avatar of MostHated
MostHatedFlag for United States of America

asked on

Script to create a linux user on one server, when a DB user is made on another?

Hello all,
    I am looking for a way to have a linux user created on a sFTP gateway automatically with the credentials that were used when a user was created in a database. We have a web application in which we onboard a user and create their account. We would then have to go and manually create a linux user on the sFTP gateway, as it uses standard linux users as the credentials to login to FTP.

Is there a script (perhaps bash or python?) that can either use some sort of trigger to know when a DB user is made, then create a user on the FTP server. If it can use the same credentials that would be ideal, but if not, it can create a random password and then we can have it email it to the user perhaps. If there is nothing made already, if someone could point me in the right direction as to the best way to go about this, or what language would be ideal, please do.

Thanks!
Avatar of David Favor
David Favor
Flag of United States of America image

This will be a custom script based on your environment.

You'll just fire off ssh + command to create new user on your SFTP gateway machine.

You'd fire off your ssh command each time you onboard a new database user.

You might go one step further + run a nightly CRON job to check all database users against SFTP gateway users + notify someone if there's a mismatch, which means your ssh command failed.
ASKER CERTIFIED SOLUTION
Avatar of Erik Schminke
Erik Schminke
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MostHated

ASKER

Thanks for the info. I actually ended up doing something very close to that just before you replied. All s well. : )