Installation and management of SSH

SSH server is a software that allows you to manage computers from distance. Today I will install it and show you how to create a new account with a webpage.

Installing SSH

I started installing SSH with the command sudo apt-get install openssh-server (Like everytime it is still important update your package list before installation (sudo apt-get update).)

After this I tested my server and logged in with my own account. Since I am using the live Cd I need to create a password first or I am not able to continue very far (can be done with passwd). If you are not sure about your username you can simply check it by running the command whoami.


I logged in as xubuntu ssh xubuntu@localhost. The connection had been created and so far everything seemed to be fine. Time to create a new account!

Creating an account

sudo adduser [username] is the needed command when creating a new account. In my case I created a test user called maryrascal, so I typed sudo adduser maryrascal in my Terminal.


At this point we can add some additional information about the user (you should at least write the full name). Remember to choose your password carefully - it should contain both lower and upper case letters, special characters and numbers. In ideal case the password doesn't resemble of a real word and is fairly long, more than 8 characters.

When creating a webpage for a new user you must have Apache installed on your computer (more information from my previous post). 

I made sure I was logged in as maryrascal and created a directory mkdir public_html and put there a file nano index.html for the webpage. If everything goes as it should the site will appear to localhost/~maryrascal. 

Finally I checked that the access rights of these files really belong to maryrascal and not to root by writing ls -l.


Analyzing the AuthLog

The AuthLog is located in cd /var/log and can be read with tail auth.log and it contains all the user logins.

Logging in SSH successfully

On September 26nd at 15:14:34 o'clock (GTM+0) in xubuntu's server the accepted password was entered and the session opened for user maryrascal.

Logging in SSH failed

On September 26nd at 15:12:25 o'clock (GTM+0) in xubuntu's server a wrong password was entered totally 3 times.

Using sudo succesfully

On September 26nd at 15:18:16 o'clock (GTM+0) xubuntu used a sudo command in directory /home/xubuntu as root user with a command sudo apt-get update.

Using sudo failed

On September 26nd at 15:20:59 o'clock (GTM+0) maryrascal (who is NOT a sudoer) tried to run a sudo command in /home/maryrascal with sudo apt-get install tetris but this command couldn't be executed because there wasn't such a file or directory existing and the session was closed. 


System information - OS: Windows 8 64bit Manufacturer: Dell Inc.Model: Inspiron 3721 BIOS: A05 Processor: Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz (4 CPUs), ~~1,8GHz Memory: 8192MB RAM

Based on Linux course by Tero Karvine (http://terokarvinen.com/)

Comments

Popular Posts