Question: I am not much experienced with ubuntu servers and ssh connections, but I would like to allow ssh connections in a ubuntu machine. I am trying to connect (ssh) to this ubuntu machine (which I setup in a virtual machine). That's the server status:

[![enter image description here](https://i.stack.imgur.com/Thv8t.jpg)](https://i.stack.imgur.com/Thv8t.jpg)

And these are the host info:

[![enter image description here](https://i.stack.imgur.com/SZmH5.jpg)](https://i.stack.imgur.com/SZmH5.jpg)

However I am unable to establish a connection:

```
ssh -X sudoname@10.0.2.15

```

> 
> ssh: connect to host 10.0.2.15 port 22: Connection timed out
> 
> 
> 

I guess I am missing something and I would be glad for any help.

Answer: 
I propose you to install nginx to forward HTTP requests from standard `80` port to the Jenkins page. Here is a small example of setting for nginx.conf file (it works fine for me).
On my Ubuntu machine I edited file `/etc/nginx/sites-available/default` (insert your ip address instead of mine):

```
location / {
    # First attempt to serve request as file, then
    # as directory, then fall back to displaying a 404.
    #try_files $uri $uri/ =404;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://192.168.56.103:8080;
    proxy_redirect http://192.168.56.103:8080/ $scheme://$host:8080/
}

```

Also I had to comment the line '**#try\_files $uri $uri/ =404;**' 'cos otherwise I receiver 404 error.
Restart nginx `sudo /etc/init.d/nginx restart`.
Now if you point your browser to the `http://ci.mymachine.com` you should be redirected to the Jenkins page. Press `Ctrl+F5` for 'hard' refresh of the page.
Hope that helps.
Here is the [link](https://serverfault.com/questions/536576/nginx-how-do-i-forward-a-http-request-to-another-port) to the discussion.
I was able to connect to port 80 with the iptable configurations mentioned in the jenkins document, mentioned in question(that configuration works correctly for ubuntu 16.04 eventhough that documentation says they did not test that for ubuntu 16.04). 

The problem was, this machine is an amazon ec2 instance as mentioned in the question. There was no inbound rules created for http port(80) for this machine in amazon console. After creating inbound rule using amazon console, now I can access the url `http://ci.mymachine.com` without any issue.