Ssh and openSsh server

#OpenSsh-server
So first of all to start I need to have a server to provide connection. To do so – type in terminal “sudo apt-get install openssh-server”. You won’t have a time even to make a cup of coffee ’cause your server will be up and running after couple of seconds. Now to test it I will create new user and connect to my own computer through ssh. “sudo adduser [nameForUser]” in my case it was like “sudo adduser testalex123″. And yeaps – new user is created.

#Ssh connection
Now for test purposes it is time to logon. To do so the following command should be executed: “ssh localhost@testalex123″ where localhost is domain name for my own ip address and after (at) sign comes user name. The same can be done through typing the ip, to know your ip is enough to type “ip addr”. So my private ip inside my lan is 192.168.0.10. So let’s try that one. And as I said the following: “ssh testalex123@192.168.0.10″ works exactly the same way just fine.

#Doing things remotely
After successful connection – everything you can do on your own computer – you can do as well remotely, or in my case being logged on with one account I imitate that my other account is located somewhere else. But yeah, in previous post “Appache and MySql” I already installed web server and set it up to user own directories. So let’s create a personal web page for our new, figuratively speaking, remote user using ssh. After establishing connection check the working directory by command “pwd”. If it shows “/home/testalex123″ then we are good to go. Firstly we need folder for personal web page, so type following: “mkdir public_html” and then simply go into it “cd public_html”. Now we need an index page and some simple html mark-up to test things. To do so, we can used terminal based text editor, but since we just need to test things we can simply type command: “echo ‘<h1>Hello</h1><p>ssh working properly. <h3>We are online and ready</h3>’ > index.html”. Alright so the final part is actual test – navigate browser to “localhost/~testalex123″
SshTestScreen
So if you see that in your browser – then the surgery was successful. Yes, we manged to do things figuratively remotely and what is more important – it wan no more difficult then doing things on your own machine. That’s it!

530136

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>