inging I ask, how do I make ssh account from the website?
vps connects us to the website so that visitors can make ssh account on the form provided, thank you
Well, you could accomplish it by having the website add the stuff to a MySQL database, then have cron job come along and check for new users and add them using adduser or something similar.
@perennate said:
Well, you could accomplish it by having the website add the stuff to a MySQL database, then have cron job come along and check for new users and add them using adduser or something similar.
is there a guide that can steer me?
eg links to tutorials to make it from scratch?
I really need this for my school assignment
And add this to /etc/sudoers via visudo so that your web server user has passwordless access to sudo:
> www-data ALL=(ALL) NOPASSWD: ALL
>
And add some sanity checking to make sure username is valid format.
This fact will be published as well.
suppose there is a visitor goes to my website, and fill out the form to create an account ssh, then the ssh account immediately and automatically be connected to the VPS
Comments
illustration http://prntscr.com/2wde5l
But really you should use some kind of account management API. Why do you need to create shell accounts anyway?
Edit: actually adduser -batch doesn't seem to exist; maybe just useradd -G group username then? not sure how to specify password
I mean so that visitors can make their own account ssh to my vps server
illustration http://prntscr.com/2wde5l
Well, you could accomplish it by having the website add the stuff to a MySQL database, then have cron job come along and check for new users and add them using adduser or something similar.
is there a guide that can steer me?
eg links to tutorials to make it from scratch?
I really need this for my school assignment
I mean, if it's just a school assignment you can just do
And add this to /etc/sudoers via visudo so that your web server user has passwordless access to sudo:
And add some sanity checking to make sure username is valid format.
This fact will be published as well.
suppose there is a visitor goes to my website, and fill out the form to create an account ssh, then the ssh account immediately and automatically be connected to the VPS
Why do you want to do this? Sounds like a recipe for disaster.
+1. but he said something about school project
Surely you'd be better off limiting www-data's sudo access to only one command? (useradd)
You'd be better off not creating a web interface for people to create shell accounts on your server.
Ah, isn't this something he should figure out on his own then? People here have already given you most of it.