$ yum update
$ yum install curl git vim`
$ git config --global user.name "Your name"
$ git config --global user.email "[email protected]"
$ curl -L get.rvm.io | bash -s stable
$ source /etc/profile.d/rvm.sh
$ rvm install 2.1.0
$ rvm use 2.1.0 --default
$ gem install bundle
$ yum install nginx
Put this line just before -A INPUT -j REJECT --reject-with icmp-host-prohibited
in /etc/sysconfig/iptables
file:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
Then restart iptables:
$ /etc/init.d/iptables restart
This will create user rails
without password and group deploy
. Use key pair to access server.
$ useradd rails
$ groupadd deploy
$ usermod -a -G deploy rails
Run visudo
and append this line so that user can access sudo:
rails ALL=(ALL) ALL
Copy authorized_keys
from root to new user directory and change its permission, so that we can use the same public key:
$ cp /root/.ssh/authorized_keys /home/rails/.ssh/authorized_keys
$ chmod 0440 /home/rails/.ssh/authorized_keys
$ chown rails:deploy /home/rails/.ssh/authorized_keys
$ chattr +i /home/rails/.ssh/authorized_keys
Change ssh configuration /etc/ssh/sshd_config
to disable Root login and ask for password:
PermitRootLogin no
PasswordAuthentication no
Then run sudo /etc/init.d/sshd restart
to restart SSH config. DON'T LOGOUT FROM SSH until you are sure that you can ssh and sudo su
with the new user.
#list volumes
lsblk
#expand volume
sudo resize2fs /dev/xda