Adding a new user with sudo privileges is pretty simple.
Add the user with the adduser script. It will ask you a few things about the new user, and prompt for a new password. A home directory will automatically be created for the user at /home/username, but you can specify this to be anywhere using the –home option:
sudo adduser --home /john john
Then to give sudo rights to it, edit the sudo config file as the rails user:
sudo sudoedit /etc/sudoers
Duplicate the last line, but changing "rails" to whatever your new username is:
rails ALL=(ALL) ALL john ALL=(ALL) ALL
Now you need to configure SSH to allow access for the new user. Edit the ssh config at /etc/ssh/sshd_config and add a new allow users line at the bottom. You'll see the other user access lines in there:
AllowUsers rails@* AllowUsers john@*
Then reload ssh:
sudo /etc/init.d/ssh reload
Our Brightbox GEM Capistrano recipes do assume that you're using the rails user in the usual home directory though. Changing the user and home directory will cause problems for it, but if you're using your own recipes, you can obviously customize them however you wish.