Installing an SSH server

Installing an SSH server on Lubuntu (Lite Ubuntu)

sudo apt-get install openssh-server
Advertisements

RASPBIAN JESSIE LITE as web server

Why the LITE version?

My objective is to setup a headless web server– and the lite version is perfectly what I need.

Installation and Setup

Download RASPBIAN JESSIE LITE from this link.

Follow the instructions here to install the operating system images.

By default, the pi is using a default username=pi and password=raspberry. To add/change user or change password, follow instructions from here.

Enable WIFI connection

In my setup, I need a WIFI connection to proceed in updating and upgrading. Here is a way to enable it taken from the instructions provided from this link.

In terminal:

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

and, add these lines at the bottom:

network={
  ssid="<router name>"
  psk="<password>"
}

then, reboot.

sudo reboot

Check now if you are connected to the network: there is wlan0 and IP address when ifconfig is ran.

Fetch the latest updates and upgrades

sudo apt-get update              # Fetches the list of available updates 
sudo apt-get upgrade             # Strictly upgrades the current packages

Enable SSH

UPDATE 2016
The default raspberry distribution is now raspbian jessie, and uses systemd instead of sysvinit. The command line is now systemctl enable ssh.socket (although ssh should be enabled by default). then reboot

In terminal:

sudo systemctl enable ssh.socket

Web server

To install Apache/MySQL/PHP, follow instructions provided from this link. You may skip part of instructions provided for WordPress. But here are the quick steps I did:

Install Apache

sudo apt-get install apache2 -y

Test the web server– http://192.168.0.102/

Install PHP

sudo apt-get install php5 libapache2-mod-php5 -y

Test PHP by creating an index.php file and put the line below then ran– http://192.168.0.102/index.php

<?php phpinfo(); ?>

Install MySQL

sudo apt-get install mysql-server php5-mysql -y

Restart Apache:

sudo service apache2 restart

 

SSH Tunnel (Local connection)

I am using HeidiSQL MySQL client in windows. While my MySQL is in Pi, I am connecting to MySQL via SSH (see this link for full instructions).

In terminal/cmd:

ssh -L 3307:localhost:3306 pi@192.168.0.102

 

Other Resources