The sixth assignment for the Tero Karvinen’s Linux Basic course was to install the SSH server and create a test user. I have a Sony Vaio VPC-EH2F1E. The operatin system I use is Windows 7 Home Premium 64-bit with service pack 1. The processor is a Intel Core i3-2330M 2,20GHz. Installed RAM 4 GB.
Firstly I ran 12.04.3 version xUbuntu 32 bit from my Live-CD and connected my computer with my home WiFi.
Step1 Installing SSH server
Menu -> Accessories -> Terminal emulator
- First thing is always update the packages with the command $ sudo apt-get update
- Next is to install the SSH server with the command $ sudo apt-get install openssh-server (when you don’t know the exact name you can use the search command: $ apt-cache search . e.g. $ apt-cache search ssh server ).
- Testing the SSH server:
- For checking who is the user is the command $ whoami is used
- For changing the password the command $ passwd is used. It is important to use a strong password with different characters and numbers. From this page ypu can find some tips about strong passwords: https://billing.serverorigin.com/knowledgebase.php?action=displayarticle&id=40.
- Then you can test your server with the command $ ssh xubuntu@localhost, The password is asked. When you want to quit your connection use the command $ exit.
Step 2 Adding the test user
- For adding a user you need to use the command $ sudo adduser [username] (I added $ sudo adduser kristiinaj)
- Then you need to give a password for the user. Remember that it should be a strong password.
- Then you can add information about your user.
The user kristiinaj is added. I tested it with the following command: $ ssh kristiinaj@localhost. If you want to quit the connection use the command $ exit.
When you want to automate the login with the your user, You should:
- run the ssh-keygen
- run the command to copy the keys in your target server $ ssh-copy-id [username]@localhost. (In my case $ ssh-copy-id kristiinaj@localhost.) It will ask the users password
- Then when you login with your user using the command: $ ssh [username]@localhost. (In my case: $ ssh kristiinaj@localhost.) This time the password is not anymore asked. When you want to quit the connection use the command $ exit
Used sources:
https://billing.serverorigin.com/knowledgebase.php?action=displayarticle&id=40. Accessed: 6.10.2013
http://serverfault.com/questions/241588/how-to-automate-ssh-login-with-password. Accessed: 6.10.2013