Skip to content

Instantly share code, notes, and snippets.

@aratak
Last active September 5, 2015 10:34
Show Gist options
  • Save aratak/478350 to your computer and use it in GitHub Desktop.
Save aratak/478350 to your computer and use it in GitHub Desktop.
sql script for rails db on production
CREATE USER 'testuser'@'%' IDENTIFIED BY '***';
GRANT USAGE ON * . * TO 'testuser'@'%' IDENTIFIED BY '***' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
CREATE DATABASE IF NOT EXISTS `testuser` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT ALL PRIVILEGES ON `testuser` . * TO 'testuser'@'%';
sudo su
groupadd www
useradd aratak --shell /bin/bash --group www --home /home/aratak
mkdir /home/aratak
chown aratak:www /home/aratak
passwd aratak
# add username to AllowUsers /etc/ssh/sshd_config
# add `aratak ALL=(ALL) NOPASSWD:ALL` to the /etc/sudoers
sudo service ssh restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment