Sponsored Content
Top Forums UNIX for Advanced & Expert Users ssh port forward over three server Post 302235917 by strike-2 on Saturday 13th of September 2008 07:57:37 PM
Old 09-13-2008
My guess it you can only ssh to server2 fron server1 due to a rule in the firewall.
You might want to try the forward from server1 to server2 and connecting with tour client to the (forwarded) port on server1.
(the forwarded port on the server may be bound to localhost, there might be an option to avoid this)

If you really can't access the port on server1 fron client, you can use two seperate ssh tunnels:
server1> ssh -L 2222:server2:1111
# Leave this one open
client> ssh -L 1111:server1:2222

This will forward port 1111 on client to port 2222 on server1, which is forwarded to port 1111 on server2.
(different port servers only as illustration)
 

10 More Discussions You Might Find Interesting

1. IP Networking

SSH Port Forwarding - sharing the same port

Hi Linux/Unix Guru, I am setting Linux Hopping Station to another different servers. My current config to connect to another servers is using different port to connect. e.g ssh -D 1080 -p 22 username@server1.com ssh -D 1081 -p 22 username@server2.com Now what I would like to have... (3 Replies)
Discussion started by: regmaster
3 Replies

2. IP Networking

port forward & DYNDNS Inquiry

Hi, Is there anyone know how to make port forward? And also, how to set up DYNDNS with router? (1 Reply)
Discussion started by: eel
1 Replies

3. IP Networking

forward a Network Device via ssh

Hey foks my problem looks like this: Computer 1 has two network interfaces (A and B). It's connected to computer 2 via ssh using network interface A. kann I forward network interface B to computer 2, so it shows up for example in ifconfig on computer 2? how? should i use something else than... (1 Reply)
Discussion started by: smf15
1 Replies

4. IP Networking

Forward ftp from one server to another

What I want to do is to connect to a server A (connected to a public IP) and forward the FTP connexion to server B (Connected to another public IP). CLIENT ==>Debian SERVER A===> Debian SERVER B with ProFTPD Passive FTP uses two ports, 21 that carries the commands and any port from about... (5 Replies)
Discussion started by: PatriceVigier
5 Replies

5. Cybersecurity

Different ssh fingerprints on server vs the one on port 22

Hi Guys, My certificate in /etc/ssh is different to what is on port 22. username@server:~$ ssh-keyscan -p 22 127.0.0.1 > /tmp/rsa.tmp # 127.0.0.1 SSH-1.99-OpenSSH_33.33 username@server:~$ ssh-keygen -lf /tmp/rsa.tmp 1024 46:something..................... 127.0.0.1... (0 Replies)
Discussion started by: mu100
0 Replies

6. UNIX for Dummies Questions & Answers

Different ssh fingerprints on server vs the one on port 22

Hi Guys, My certificate in /etc/ssh is different to what is on port 22. username@server:~$ ssh-keyscan -p 22 127.0.0.1 > /tmp/rsa.tmp # 127.0.0.1 SSH-1.99-OpenSSH_33.33 username@server:~$ ssh-keygen -lf /tmp/rsa.tmp 1024 46:something..................... 127.0.0.1... (0 Replies)
Discussion started by: mu100
0 Replies

7. Ubuntu

Iptables forward traffic to forward chain!!!

Hi, I am new to linux stuff. I want to use linux iptables to configure rule so that all my incoming traffic with protocol "tcp" is forwarded to the "FORWARD CHAIN". The traffic i am dealing with has destination addresss of my machine but i want to block it from coming to input chain and somehow... (0 Replies)
Discussion started by: arsipk
0 Replies

8. UNIX for Advanced & Expert Users

ipf/ipnat NAT/port forward issues

I've been going crazy trying to get this working. Here's the situation: we have a Solaris 10 box that connects an internal network to an external network. We're using ipf/ipnat on it. We've added a couple of new boxes to the internal network (192.168.1.100, .101) and want to be able to get to port... (1 Reply)
Discussion started by: spakov
1 Replies

9. Debian

Iptables Nat forward port 29070

Hello, the Nat and the forward worked on my debian server up to the reboot of machines. The following rules*: /sbin/iptables -t nat -A PREROUTING -p tcp -i eth2 -d xxx.xxx.xxx.xxx --dport 29070 -j DNAT --to-destination 10.0.1.7:29070 /sbin/iptables -A FORWARD -p tcp -i eth2 -o eth0 -d... (0 Replies)
Discussion started by: titoms
0 Replies

10. Red Hat

Port Forward to VPN client.

Hi all, I can't port forward from WAN to VPN Client. VPN Client Ubuntu 18 192.168.0.16 Port 6000 VPN Gateway for LAN clients Centos 192.168.0.12 Router 192.168.0.1 I can forward to the VPN Client if VPN is not connected if I forward Port 6000 from 192.168.0.1 directly to 192.168.0.16.... (2 Replies)
Discussion started by: stinkefisch
2 Replies
Test::TCP(3pm)						User Contributed Perl Documentation					    Test::TCP(3pm)

NAME
Test::TCP - testing TCP program SYNOPSIS
use Test::TCP; my $server = Test::TCP->new( code => sub { my $port = shift; ... }, ); my $client = MyClient->new(host => '127.0.0.1', port => $server->port); undef $server; # kill child process on DESTROY Using memcached: use Test::TCP; my $memcached = Test::TCP->new( code => sub { my $port = shift; exec $bin, '-p' => $port; die "cannot execute $bin: $!"; }, ); my $memd = Cache::Memcached->new({servers => ['127.0.0.1:' . $memcached->port]}); ... And functional interface is available: use Test::TCP; test_tcp( client => sub { my ($port, $server_pid) = @_; # send request to the server }, server => sub { my $port = shift; # run server }, ); DESCRIPTION
Test::TCP is test utilities for TCP/IP programs. METHODS
empty_port my $port = empty_port(); Get the available port number, you can use. test_tcp Functional interface. test_tcp( client => sub { my $port = shift; # send request to the server }, server => sub { my $port = shift; # run server }, # optional port => 8080 ); wait_port wait_port(8080); Waits for a particular port is available for connect. OO-ish interface my $server = Test::TCP->new(%args); Create new instance of Test::TCP. Arguments are following: $args{auto_start}: Boolean Call "$server->start()" after create instance. Default: true $args{code}: CodeRef The callback function. Argument for callback function is: "$code->($pid)". This parameter is required. $server->start() Start the server process. Normally, you don't need to call this method. $server->stop() Stop the server process. my $pid = $server->pid(); Get the pid of child process. my $port = $server->port(); Get the port number of child process. FAQ
How to invoke two servers? You can call test_tcp() twice! test_tcp( client => sub { my $port1 = shift; test_tcp( client => sub { my $port2 = shift; # some client code here }, server => sub { my $port2 = shift; # some server2 code here }, ); }, server => sub { my $port1 = shift; # some server1 code here }, ); Or use OO-ish interface instead. my $server1 = Test::TCP->new(code => sub { my $port1 = shift; ... }); my $server2 = Test::TCP->new(code => sub { my $port2 = shift; ... }); # your client code here. ... How do you test server program written in other languages like memcached? You can use "exec()" in child process. use strict; use warnings; use utf8; use Test::More; use Test::TCP 1.08; use File::Which; my $bin = scalar which 'memcached'; plan skip_all => 'memcached binary is not found' unless defined $bin; my $memcached = Test::TCP->new( code => sub { my $port = shift; exec $bin, '-p' => $port; die "cannot execute $bin: $!"; }, ); use Cache::Memcached; my $memd = Cache::Memcached->new({servers => ['127.0.0.1:' . $memcached->port]}); $memd->set(foo => 'bar'); is $memd->get('foo'), 'bar'; done_testing; AUTHOR
Tokuhiro Matsuno <tokuhirom@gmail.com> THANKS TO
kazuhooku dragon3 charsbar Tatsuhiko Miyagawa lestrrat SEE ALSO
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-02-01 Test::TCP(3pm)
All times are GMT -4. The time now is 01:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy