Putty tunnel: Relay access denied - linux

I will try to connect I logged on locally (127.0.0.1) on Putty. Then I try to connect through the tunnel to the remote server.
I get a "Relay access denied" error. How can I solve it?

To get an SSH tunnel established:
In PuTTY, on the configuration screen go to Connection > SSH > Tunnels. Set the source port to something like 2500, which is actually localhost:2500. Set Destination to mailserver.example.com:25 (SMTP port) for whatever is the hostname of your mail server.
Connect over SSH, and you have now established a tunnel to port 25 on the destination host.
On your local machine, telnet to your local port, and you are now talking to port 25 on the remote machine.
telnet localhost 2500

Related

Remote Desktop Connection with Ngrok

I want connect to my other computer with remote desktop connection but i need a problem.
I did setup ngrok and launched it and tried connect it but it doesn't connect.
This is what i did:
Setup and launched ngrok as:
ngrok tcp 5555
and i switched my own laptop and launched remote desktop connection and did that:
But it doesn't connect :(
Note: I allowed Remote Desktop Connection in control panel.
Did i miss something or how to do it correctly?
You have wrong port number for your remote desktop connection. You have to use default RDP port 3389.
Setup and launched ngrok as:
ngrok tcp 3389

Connect to external server over ssh

I want to connect to local address 127.0.0.1:2222 belonging to a server with IP 172.25.250.10 as user especial. The connection would be done from another place in the network. As a tip they have told me to use ip forwarding but I cannot manage to succeed.
My approach has been doing:
ssh especial#172.25.250.10 -p 2222
But this attempt returns:
ssh: connect to host 175.25.250.10 port 2222: Connection refused
In the 172.25.250.10 the 2222 port is listening for ssh connections
If I understood correctly, use the following to connect to 172.25.250.10 and use local port forwarding for port 2222.
ssh -L 2222:localhost:2222 especial#172.25.250.10

SSH tunnel always trying port 22

I want create ssh tunnel between local machine and remote server, so I use this command on my local machine:
sudo ssh -R 443:localhost:443 SERVER_IP
Everything is working, I can connect to my local machine through remote server - using port 443.
Problem is, that sometimes it just doesnt work and I get a message:
connect to host SERVER_IP port 22: Connection refused
Strange is, that connection to port 22 is working on remote (I can connect there without problem at that exact moment), weird is just, that sometimes it is working and sometimes id does not. Do you have any idea why? Or do you know what is going on?
ssh runs by default on port 22. While your command is setting up a proxy to pass port 443 from one host to port 443 on a different host, the underlying ssh connection still runs on port 22.
Connection refused means that the target host SERVER_IP is not running an sshd daemon and/or is not listening to port 22. You will need to figure out and fix whatever is wrong with the SERVER_IP machine.
22 is the default port, the ssh client will connect to it until you specify an other port using -p, example:
ssh -R 12345:localhost:12345 SERVER_IP -p 443
The error you have is not about the tunnel but about the server's port.
You should check that the server is indeed started and listening on port 22 and there's no firewall in the way.

Listening port putty tunnel does not work

The goal is to connect to my home computer from outside. The ISP blocks all the ports (and demands $$$ for business package with static ip address), so simple port forwarding on home router does not work.
I have used putty to tunnel a listening port to a remote server: R2221:###.###.###.###:2221 (to make things simpler, the test server is a simple ftp server running on my home windows machine) (the entire ip address has to be specified -- with OpenSSH 1.0 running on the linux box wildcard address results in refusal of connection) (GatewayPorts are set to on).
Netstat -a confirms that port 2221 on the linux box is open and listening. However, whenever I try to connect to that port, it simply hangs. Command line ftp client says "connected to ###.###.###.###" and that's it. Running netstat again shows dozens of opened connections to port 2221, all coming from my windows box (I tried using browser as well as command line ftp client).
Which step am I missing?
Tried with RDP, VNC and FTP -- all of them hang, all of them connect when connecting through my home network (or my home router).
EDIT The setup is as follows:
PC 1 (windows) has FTP service running on port 2221. It uses PuTTY to tunnel a listening port to PC 2 (linux). PC 2 does show listening port when running netstat. Connecting to port 2221 on PC 2 either form PC 2 or from PC 3 results in hanging.
EDIT 2 Aaaand it worked. Using 127.0.0.1 instead of the remote machine's ip address was what corrected it. Thanks a lot.
Are you sure your -R command is correct? From what you say I suppose the command should be R2221:127.0.0.1:2221. The -R ssh option in form of port:host:hostport does the following: it opens port port on the remote side and forwards the connection to that port to local address host:hostport, and this connection is made from the local machine.
To make your local machine (the one that is running ssh client, e.g. PuTTY) connect to your local FTP server running on the same machine, use 127.0.0.1 as an address.
It also explains why you see a strange behaviour: when you actually connect to xxx.xxx.xxx.xxx:2221, it forwards the connection to the same address xxx.xxx.xxx.xxx:2221 and you get some kind of a loop.

Accessing application in browser over SSH proxy on localhost.

I have SSH access to a web server that is hosting an application on port 8080. I have a SSH session setup and a proxy configured on Chrome to redirect requests to SSH tunnel. I basically configured it using these instructions: http://drewsymo.com/2013/11/ssh-tunnel-in-30-seconds-mac-osx-linux/
I can confirm using Whats My IP that my IP is that of the SSH session and that is working correctly.
But I cannot figure out how to access the local application on the web server that I am SSHed into. When I try localhost:8080 the SSH session gives me an error "channel X: open failed: connect failed: Connection refused"
Any idea what is going on?
You can just create a port-specific tunnel:
ssh -L18080:localhost:8080 username#theothermachine
and then go to localhost:18080 on your local machine. The tunnel will forward your request to port 8080 of the localhost on the other end (and of course, localhost on the other end is the other machine itself). If that doesn't work for some reason, then replace localhost by 127.0.0.1 in the ssh command.

Resources