*Social Shell
===================

'SSHartre: Shell is other people'

We create *user accounts* on the server for each participant and introduction to using the *shell*



Superuser

-------------------

Select one person to play the *superuser*, preferrably somebody that never used the shell before. Those with experience should offer to help.

The *superuser* opens a terminal window and types the command:


You will see the following:

type:
and then the password


You should see the relearn server's welcome message.

If things go wrong (you don't see the message), just start again from:

You can now create accounts for the other people seated at your table (and also one for yourself!). 

Each person should choose a *username* (it should not have spaces) and write it on the IP card and pass it to the super user, who in turn should perform the command:

Now, while logged in as *admin* to the server, the superuser enters the following commands to create a user for each person:


When you use sudo the first time, you will need to re-enter the password "relearn".

You will see:


Fill in the *administrative questions* if you like (or leave them blank ;)
For the password: give each user the same password "relearn" (they can change it later).

Finally *add each user to the "www-data" group* (use the same USERNAME):


Having all the users in the www-data group allows us to share files with each other using the web server.
That's it, you have made a user login: pass back the card to the user.

when all users have been added, the superuser logs out by typing:


You should see:


What to do with your new login

----------------------------------------------------

Once you have been given your card back from the superuser, try to login with your username:



The first time you connect, you will see the following:

type: 


Use the password "relearn".

You are now connected to the relearn server.


The *who* command will show you others that are logged in, you can speak to other users with the write command, just use their username:
What pts/n means in the list? 
"A tty is a native terminal device, the backend is either hardware or kernel emulated. [ what is hardware? a typewriter hardwired to the motherboard?]
A pty (pseudo terminal device) is a terminal device which is emulated by an other program (example: xterm, screen, or ssh are such programs). 
A pts is the slave part of a pty."

Try:




The write command will wait for your input; it reads from *stdin* (or "standard in") which means it reads from the keyboard by default. 

Type your message, then hit return and press _one time (on a blank line) Ctrl-D (which means "end of file").

(NB: In OSX: you want to use the _ctrl_ key and not the regular _Command_ key (which splits the terminal. Pressing Cmd-Shift-D will undo this)

Note: Press it just once (at the start of a blank line) when a command (like write) is reading from stdin. If you press Ctrl-D again (at the normal shell prompt) you will logout from the server. To login, you will then need to start again with the ssh command.

To check whether you are still logged in, your prompt should look 


To prevent messages from appearing on your screen



BONUS


Try also:

You can customize your "plan" by adding a file called .plan in your homefolder.
The mail command can be used to compose and receive email messages.


Command History

-----------------
You can generally use the arrow keys to go back and forth in the history of your commands. Try it!

Read a manual


Try some more commands:



When you use the *man* command you enter a program to read the manual of a particular command; you can scroll with the arrow keys and you can press _q_ to quit it and return to the terminal.

When you start figlet without any options, it also reads from *stdin* (standard input). By default this is the keyboard; note how it responsds as you type. To stop, press Ctrl-D on a line by itself.

Programs often take options, typically preceded by the "dash" character (-). Like:


The explanation for all the options of a program are given in the man page:



Promiscuous Pipelines

-----------------------
The special character "|" is called the pipe and can be used to connect multiple commands.

Try these commands:

        date +%A

        date +%A | figlet
        

Password

--------------------
You can change you password if you want using:

    passwd


add yourself to the sudo group

(level: advanced)

you can add yourself to the sudo-group, and use the sudo-command.
to do this, you should be root. To become root, type the command







../images/who.png