Skip to content

Latest commit

 

History

History
82 lines (45 loc) · 5.5 KB

1.md

File metadata and controls

82 lines (45 loc) · 5.5 KB

Day 1 - Accessing your server

INTRO

You should now have a remote server setup running the latest Ubuntu Server LTS (Long Term Support) version. You alone will be administering it. To become a fully-rounded Linux server admin you should become comfortable working with different versions of Linux, but for now Ubuntu is a good choice.

Once you have reached a level of comfort at the command-line then you'll find your skills transfer not only to all the standard Linux variants, but also to Android, Apple's OSX, OpenBSD, Solaris and IBM AIX. Throughout the course you'll be working on Linux - but in fact most of what is covered is applicable to any system in the "UNIX family" - and the major differences between them are with their graphic user interfaces such as Gnome, Unity, KDE etc - none of which you’ll be using!

Although there is a "root" user, you will be logging in and working from the user account that you setup. Because this is a member of the group "sudo" it is able to run commands "as root" by preceeding them with "sudo".

YOUR TASKS TODAY:

  • Connect and login remotely your server
  • Run a few simple simple commands to check the status of your servers
  • Change your password

INSTRUCTIONS

Remote access used to be done by the simple telnet protocol, but now the much more secure SSH (“Secure SHell) protocol is always used.

If you're using any Linux or Unix system, including Apple's MacOS, then you can simply open up a "terminal" session and use your command-line ssh client like this:

ssh user@<ip address>	 

For example:

ssh support@192.123.321.99

On an MacOS machine you'll normally access the command line via Terminal.app - it's in the Utilities sub-folder of Applications. On Linux distributions with a menu you'll typically find it under "Applications menu -> Accessories -> Terminal", "Applications menu -> System -> Terminal" or "Menu -> System -> Terminal Program (Konsole)"- or you can simply search for your terminal application.

On Microsoft Windows there has been no suitable client built-in, or available from Microsoft - so the "standard" is a free program called PuTTy. It is written and maintained by Simon Tatham, so get it directly from his site at:

http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html 

You can download and install the full suite with "Windows installer" version. If you don't have permission to install software on the computer you are using then you can run PUTTY.exe directly from its download page without installing it. There are other SSH clients, and any should be suitable for the course.

The first time you connect to your server, you’ll receive a warning that you're connecting to a new server - and be asked if you wish to "cache the host key". Do this. Now, if you get a warning in future connections it means that either: (a) you are being fooled into connecting to a different machine or (b) someone may be trying a "man in the middle" attack.

So, now login to your server as your user - and remember that Linux is case-sensitive regarding user names, as well as passwords.

Once logged in, notice that the "command prompt” that you receive ends in $ - this is the convention for an ordinary user, whereas the "root" user with full administrative power has a # prompt.

Try these simple commands:

ls           	 
uptime   	 
free       	 
df -h      	 
uname -a   

Now use the passwd command to change your password. To do this, think of a new, secure password, then simply type passwd, press “Enter” and give your current password when prompted, then the new one you've chosen, confirm it - and then WRITE IT DOWN somewhere.

A common Linux convention is that simply selecting text in the terminal session does a "copy", and within the terminal a RightClick is considered a paste. Test this out by copying some text from Windows or MacOS and right-clicking into your terminal session - and also try the reverse: selecting text in the terminal and pasting into windows. Getting the hang of this is a useful skill.

Log out by typing exit.

You'll be spending a lot of time in your SSH client, so it pays to spend some time customising it. At the very least try "black on white" and "green on black" - and experiment with different monospaced fonts, ("Ubuntu Mono" is free to download, and very nice).

POSTING YOUR PROGRESS

Regularly posting your progress can be a helpful motivator. Feel free to post to the subreddit a small introduction of yourself, and your Linux background for your "classmates" - and notes on how each day has gone.

Of course, also drop in a note if you get stuck or spot errors in these notes.

WRAP

You now have the ability to login remotely to your own server. Perhaps you might now try logging in from home and work - even from your smartphone! - using an ssh client app such as "Termux". As a server admin you'll need to be comfortable logging in from all over. You can also potentially use JavaScript ssh clients (search for "consolefish"), or from a cybercafe - but these options involve putting more trust in third-parties than most sysadmins would be comfortable with when accessing production systems.

EXTENSION

If this is all too easy, then spend some time reading up on:

  • "SSH Tunneling"
  • "Password-less SSH login"

RESOURCES