8/10/2019 01 Intro Lab Unix
1/27
Intro Lab 1 Working with a Unix Server
POWER SYSTEM DYNAMICS AND CONTROL (EEEN40550)
Prof. Federico Milano
Email: [email protected]
Tel.: 01 716 1844
Room 157a - Electricity Research Centre
School of Electrical, Electronic and Communications Engineering
University College DublinDublin, Ireland
Dublin, 2014 Intro Lab 1 Working with a Unix Server - 1
8/10/2019 01 Intro Lab Unix
2/27
8/10/2019 01 Intro Lab Unix
3/27
Unix Terminal
Thessh protocol is a cripted tunnel that allows connecting to a Unix terminal.
A terminal is basically a window where the user inputs instructions through a command
line.
A Unix terminal is similar but way much powerful than the Windows command prompt.
Dublin, 2014 Working with a Unix Server - 2
8/10/2019 01 Intro Lab Unix
4/27
How a Unix Terminal Looks Like
Dublin, 2014 Working with a Unix Server - 3
8/10/2019 01 Intro Lab Unix
5/27
SSH Clients
To connect to a terminal through SSH, we need a SSH Client.
On Windows, a SSH Client is simply a program that opens a Unix terminal once login
information are provided.
There are several SSH Clients for Windows. Some of them are free software.
Dublin, 2014 Working with a Unix Server - 4
8/10/2019 01 Intro Lab Unix
6/27
SSH Client: Putty
Dublin, 2014 Working with a Unix Server - 5
8/10/2019 01 Intro Lab Unix
7/27
SSH Client: Putty
Dublin, 2014 Working with a Unix Server - 6
8/10/2019 01 Intro Lab Unix
8/27
SSH Client: Putty
Dublin, 2014 Working with a Unix Server - 7
8/10/2019 01 Intro Lab Unix
9/27
Login using an SSH Client Username
Write your username.
The user name is the initial of your first name plus your first surname, all lower case.
Example: John Smith jsmith
Dublin, 2014 Working with a Unix Server - 8
8/10/2019 01 Intro Lab Unix
10/27
Login using an SSH Client Password
Press enter and then write your password.
The password is a random sequence of 8 digits:
Example:
031SAsfd
Note that, for security reasons, your password will not be displayed while typing.
Please do not change your password!
Dublin, 2014 Working with a Unix Server - 9
8/10/2019 01 Intro Lab Unix
11/27
SSH Client: Putty
Dublin, 2014 Working with a Unix Server - 10
8/10/2019 01 Intro Lab Unix
12/27
Limitations of SSH Clients for Windows
While Unix terminal is a very powerful tool, Windows limits a bit its functionalities.
For example, no windows can be open from the terminal.
You are thus limited to the command line.
This is not really an issue as, Unix, almost everything can be done from the command
line.
Dublin, 2014 Working with a Unix Server - 11
8/10/2019 01 Intro Lab Unix
13/27
SFTP Clients
The terminal allows operating on the server, but it is necessary to be able to exchange
files from the server to the local system and from the local system to the server.
This operation can be done using SFTP clients.
Again, there is plenty of choice of SFTP clients for Windows. Some of them are free
software.
Dublin, 2014 Working with a Unix Server - 12
8/10/2019 01 Intro Lab Unix
14/27
SFTP Clients
On the module website two SFTP clients are available:
CyberDuck: it provides a user-friendly GUI, but it may not work on desktop
computers of the lab.
PSFTP: only command line but it works on desktop computers of the lab.
Dublin, 2014 Working with a Unix Server - 13
8/10/2019 01 Intro Lab Unix
15/27
SFTP Client: CyberDuck
Dublin, 2014 Working with a Unix Server - 14
8/10/2019 01 Intro Lab Unix
16/27
SFTP Client: CyberDuck
Dublin, 2014 Working with a Unix Server - 15
8/10/2019 01 Intro Lab Unix
17/27
SFTP Client: CyberDuck
Dublin, 2014 Working with a Unix Server - 16
8/10/2019 01 Intro Lab Unix
18/27
SFTP Client: CyberDuck
Dublin, 2014 Working with a Unix Server - 17
8/10/2019 01 Intro Lab Unix
19/27
SFTP Client: PSFTP
Dublin, 2014 Working with a Unix Server - 18
8/10/2019 01 Intro Lab Unix
20/27
8/10/2019 01 Intro Lab Unix
21/27
SFTP Client: PSFTP
Dublin, 2014 Working with a Unix Server - 20
8/10/2019 01 Intro Lab Unix
22/27
Create and Editing Files on Unix
Apart from transferring file to and from the server, it can be useful to edit files directly
on the server.
This can be done in several ways, but using a SSH client, you are limited to command
line editors.
A possible choice is nano that can be launched from the prompt of the Putty terminal.
Dublin, 2014 Working with a Unix Server - 21
8/10/2019 01 Intro Lab Unix
23/27
Command Line Text Editor: Nano
Dublin, 2014 Working with a Unix Server - 22
8/10/2019 01 Intro Lab Unix
24/27
Being Efficient with SSH and SFTP Clients
Some tips to be efficient when dealing with SSH and SFTP clients.
Open an SSH client. This will be the terminal for main operations (e.g., executing
power flow)
Open an SFTP client to move files from and to the server.
Open another SSH client for auxiliary operations (e.g., editing files on the server)
Open as many SSH clients are you need and dedicate each one to a specific,simple operation.
Dublin, 2014 Working with a Unix Server - 23
8/10/2019 01 Intro Lab Unix
25/27
Hints and Warnings
Unix does not forgive errors. For example if you remove (delete) a file, that file is lost
forever.
The server is not a backup disk. You may loose everything due to server maintenance
operations.
The server is quite robust and student-proof, but if you mess up the server all other
users will be affected. Hence, please always think twice before launching a command.
If your connection is slow, do as much operations as possible on your local computer
and use the server only for number crunching.
You can connect to the server from anywhere (e.g., home and Starbucks).
Dublin, 2014 Working with a Unix Server - 24
8/10/2019 01 Intro Lab Unix
26/27
Exercises Do all exercises (except for exercises 5.3 and 6.x) of the Unix Tutorial available at
http://faraday1.ucd.ie/archive/software/unix.pdf
Moreover, do the following exercises:
1. Open a SSH connection using your account.
2. Open a SFTP connection using your account.
3. Create a text file on your computer and copy it to the server.
4. Edit the text file on the server using nano.
5. Copy back your edited text file on your local computer and check that changes have
been applied.
Dublin, 2014 Working with a Unix Server - 25
http://faraday1.ucd.ie/archive/software/unix.pdfhttp://faraday1.ucd.ie/archive/software/unix.pdf8/10/2019 01 Intro Lab Unix
27/27
Links Web page of the course:
http://faraday1.ucd.ie/modules/control.html
Blackboard:
https://elearning.ucd.ie
Dublin, 2014 Working with a Unix Server - 26
http://faraday1.ucd.ie/modules/control.htmlhttps://elearning.ucd.ie/https://elearning.ucd.ie/http://faraday1.ucd.ie/modules/control.html