-
Notifications
You must be signed in to change notification settings - Fork 0
Initial Setup
- VPS size: 1 GB Memory / 30 GB Disk
- Datacenter: NYC1
- Distribution: CentOS 7.3.1611 x64
###SSH Access Choose the option to import existing SSH public keys
###Initial Login
> ssh root@ip
###Setup Hostname
Confirm current hostname with hostname. To change:
hostname myserver
vi /etc/hosts - Add hostname to first line with 127.0.0.1
###Setup Timezone More details: https://www.vultr.com/docs/setup-timezone-and-ntp-on-centos-6
timedatectl set-timezone America/Chicago
timedatectl set-local-rtc 0
###Create user with sudo access We want to disable root login over SSH, so let's make a user with sudo access. Users in the "wheel" group are given sudo access in CentOS7:
> useradd -G wheel -c "Full Name" username
Set this new user's password:
> passwd username
###Move existing ssh authorized_keys to our new user's home directly to allow ssh login to this server as the user. Moving these keys will prevent also prevent hosts from logging into the server as root, but there's some additional configuration required as well.
First, let's give our user a .ssh folder:
> mkdir /home/user/.ssh/
Now move the authorized_keys:
> mv ~/.ssh/authorized_keys /home/user/.ssh/
Give the user access permissions to the authorized_keys file:
> sudo chown -R user:user /home/user/.ssh/
###Test Login In a new session, test the SSH connection as the user
> ssh user@ip
Once successfully logged in as the user, let's test and confirm we have sudo access:
> sudo ls /root
###Update the system:
sudo yum update
###Add the EPEL-Release Repo:
sudo yum install epel-release
###Install some favorite apps:
sudo yum install git nano tree tmux htop