Skip to content

Instantly share code, notes, and snippets.

@sarahbanas
Last active May 27, 2020 20:16
Show Gist options
  • Save sarahbanas/a65bf40e48e5f42b7f4f5f43e5783d61 to your computer and use it in GitHub Desktop.
Save sarahbanas/a65bf40e48e5f42b7f4f5f43e5783d61 to your computer and use it in GitHub Desktop.
Create a prosody user via shell script remotely
# make sure to have your prosody set up on your server, such as remote_prosody@yourserver, and can access root/sudo
# you can create this file and c&p the 5 lines below into the home directory
$ cd ~
$ vi create_prosody_user.sh
#!/bin/bash
sudo -s <<EOF
prosodyctl register $1 yourhost.com "$2"
EOF
# in command line
$ sudo chmod +x create_prosody_user.sh
$ ./create_prosody_user.sh myuser thepassword
# to do it via remotely
$ sshpass -p YourPassword ssh remote_prosody@yourhost ./create_prosody_user.sh newuser theirpass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment