hi all,
im going to design a web html form so users can input what username and password they want to make the ftp account, once they enter in a username and password they click on the submit button and it submits it to a bash script and then the bash script will run and finish of making the ftp account
the variables of both the html form and bash script are the same ie user passwd
it doesnt work, what am i doing wrong?
here is my html form page -
<form>
<form action="/scripts/create_user.sh" method="post">
Username:<br>
<input type="text" name="user"><br><br>
Password:<br>
<input type="text" name="passwd"><br><br>
<input type="submit" value="Submit">
</form>
what the form looks like -
Legacy Link Deleted
my bash script -
#!/bin/bash
dir=/sftp
group=sftpusers
echo "$user:$passwd" >> /ftp_details/accounts.csv
useradd -g $group -d $dir/$user -s /sbin/nologin $user
mkdir -p $dir/$user/data
chown root $dir/$user
chmod 755 $dir/$user
chown $user $dir/$user/data
chmod 755 $dir/$user/data
touch $dir/$user/data/WARNING_everything_in_here_will_get_removed_in_14_days_time.txt
cheers,
rob