How can I ssh to GitHub through a proxy on RedHat? - github

I am a networking novice trying to ssh from a RedHat 7 server through a proxy to GitHub and not getting anywhere.
The proxy allows ssh traffic through port 2288 to GitHub
The proxy server connection is : server.proxy.place.organisation.local:8080
I have tried commands such as:
ssh -o ProxyCommand="connect-proxy -S server.proxy.place.organisation.local:8080 %h %p" MyName#github.com
but no luck. I don't really understand how I divert ssh on port 22 through to port 2288 on the proxy - do I need to open port 2288 on the RHEL7 server to allow this to pass through? Or is there some part of the ssh command (or config) that takes care of that?

Related

Is there any possibility to establish a SSH tunneling from the server using the postgresql to the client

I have one server machine where PostgreSQL and SSH server is installed. I have another client machine from where i want to connect to the PostgreSQL on the server machine in a secure way. I used SSH tunnel which is working.
I tried to connect the client with server using:
$ ssh -L 3307:localhost:3306 user#Host -N -f
It is working. But now I am thinking whether it is possible to start the ssh tunneling from the server side. It means run a ssh command on server machine so that I get a more secure connection

SSH Jump Host via Eclipse

I have the following environment configuration:
Client -> HOST_A (public IP address) -> HOST_B (private IP address)
That being said, to avoid connecting manually to HOST_A and then to HOST_B, I'm using the jump host configuration below in the .ssh/config file.
Host HOST_B
ProxyCommand ssh -q HOST_A nc -q0 HOST_B 22
This solution works well when I'm using a regular terminal, but it doesn't work when using "Remote Systems" in Eclipse IDE. I'm not sure if I have to enforce the config file or how to configure jump hosts in Eclipse.
Does anyone have an idea how to sort this out in Eclipse?
What about an ssh tunnel?
ssh -L 2222:HOST_B:22 -N HOST_A
Then you can use localhost:2222 to connect to HOST_B with ssh. You just need Eclipse to allow you to specify a port in the ssh configuration.

How to ping to my local machine from AWS EC2 instance?

I have started an ubuntu instance on AWS EC2
e.g. [ec2-user#ip-XXX-XX-XX-XX ~]$
Inside this instance, I am running a socket program for sending the data to my local system.
The program is running properly, but not able to connect to my local IP.
I am trying to ping my local system also from AWS ec2 user, but it is also not working.But I am able to ping google(8.8.8.8).
e.g. [ec2-user#ip-xxx-xx-xx-xx ~]$ ping xxx.xxx.xx.xx(my local IP)
I have set all security groups(inbound), like All Trafic,All TCP and so on.
Sorry for bad English.
Thank You
Your computer (PC) cannot be pinged from an AWS hosted machine
This is probably because the VM on your computer is using NAT outbound to talk to the LAN, which goes to an Internet router, which sends the packets to AWS
The reverse route (inbound to your PC) does not exist so starting a ping echo request from a AWS machine will not work
It is possible to get around this by opening a pass through on your router but generally this is not a great idea
However if you want to make a socket connection securely there is a way
First, start a ssh session with remote port forwarding. In the Linux ssh client this is using the -R option.
For example, if your local system is running a listening service on port 80 and your remote system has the address of 54.10.10.10 then
ssh -R 8080:localhost:80 ec2-user#54.10.10.10
Will establish a circuit such that connections to the "localhost" on the remote ec2 server on port 8080 are connected to the "localhost" on port 80 of your local machine
If you are not using a ssh cli program, most ssh clients have a facility of this sort.
Note that it is necessary to keep the ssh session open to be able to use the connections

How to do SSH tunneling with docker (machine & compose)?

I have a mongoDB container running on an instance built with docker-machine, maintained with docker-compose. The mongoDB process isn't exposed to external traffic.
I want to connect to the remote mongoDB server using a GUI tool installed locally and without exposing any ports on the remote machine.
What's the best way to do this? Is there any way I can tunnel the connection via ssh with the docker-machinie ssh command?
What's the best way to do this? Is there any way I can tunnel the
connection via ssh with the docker-machinie ssh command?
Yes. Per the docs, docker-machine invokes the standard OpenSSH client. You can use the same -L syntax that you'd normally use for SSH tunneling. The end of the doc has an example using port 8080.

PostgreSQL SSH port forwarding via Windows/PuTTY

I have PostgreSQL 9.4 running on a Linux VPS, and I need to be able to connect to it over SSH from both Linux and Windows clients. (I will later need to connect to multiple servers, and so that all clients use the same port numbers, I'm forwarding to port 5551 for the first server, then I will use 5552, 5553, etc.)
From a Linux client I just run ssh -fNg -L 5551:localhost:5432 user#remote1.com and connect to localhost:5551 with PGAdmin3 or any other client app. Works great.
On Windows, I'm using PuTTY and Pageant. I got the connection to user#remote1.com via terminal working, then I went to the SSH Tunnels and added L5432 localhost:5551. Terminal connection still works, but when I try to connect with PGAdmin3 to localhost:5551 I get an error:
could not connect to server: Connection refused (0x0000274AD/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5551?
I resolved it. Like many things, this is obvious in hindsight. I had things backward in the SSH Tunnels setup in PuTTY. It needs to be L5551 remote1.com:5432