How to connect siterobot.io servers via SSH without Key by username and password

13 October 2015, Tuesday 0 Comments

Note: For the server security reasons, we recommended to login only with the .pem files. These instructions can cause some security problems. Please follow this guide if you are expert in linux.

By default, servers are only allowed to accept SSH Key connection requests. With this guide, you will connect your servers via SSH with username and password unless you don't have SSH Key.


1. Connect to your server via SSH

To do this, first of all you should make an SSH connection to your server.

You can add your server to Terminal on siterobot.io to make an SSH connection. If you are using windows, you can learn how to connect to your siterobot.io server via SSH with PuTTY with this guide. If you are using Mac OS X or Linux on your home computer, please follow the steps on manage server page instead.


2. Add a new user

At the begining, lets add a new user. We will connect our server with this user.

sudo adduser <username>

We should set a password to our new user. While setting a new password; the caracters that are pressed are now shown in the screen while setting a new password. But don't worry. It will work. Just enter your password and hit return. Then re-type your password and hit return again. That's it.

sudo passwd <username>

3. Permit login with password

By default, servers are not accepted password authenticated connections. We will fix this with a few changes.

sudo nano /etc/ssh/sshd_config

After open this file, lets find the #PasswordAuthentication line. Remove the first # character. And then save and close the file (ctrl-x, y, enter).

We should restart sshd service now.

sudo service sshd restart

4. Give root privileges to users

To give root privileges to users, we should modify sudoers file and append our new user.

sudo nano /etc/sudoers

Just after open this file, find the root    ALL=(ALL)   ALL line and put indicator to the next line. Write your new users just like the line above. This should looks like this:

root    ALL=(ALL)   ALL
<username>    ALL=(ALL)   ALL

From now on, you can connect to your server via SSH without .pem file. To grant root privileges, write "sudo su".

To learn how to connect to your server via SSH as root username and password, follow this guide.


Share this


Comments