LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
LinkBack Search this Thread
Old 08-22-2008, 08:15 AM   #1
G00fy
Member
 
Registered: Jul 2004
Location: Herent, Belgium, Europe, Earth
Distribution: Ubuntu 7.04
Posts: 101

Rep: Reputation: 15
Accept outgoing SSH connection


Imagine the following situation:
(my) internal server <--> || firewall || <--> (my) external server

From the internal server I can make an SSH connection to the external server. But I cannot make one from the external to the internal.

One way is ofcourse beat the security guys in order to give me access, but as I'm not a very intimidating person, I don't think that'll work.

So the question is... Is there any way I can let an internal server make a call to the external server, accept that there and be able to use the established connection as a normal shell?

I am looking much like what VNC does, but than for shell access.


Thx!
 
Old 08-22-2008, 11:01 AM   #2
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,382
Blog Entries: 1

Rep: Reputation: 60
in this document,
read the section "A Remote Desktop Assistance Trick".

erhh...that vnc thing at end of your post confused me, sorry. You actually wants to have a ssh session, right ?

on the internal server: (which must run a sshd server listening on port 22), execute as regular user:
Code:
ssh -R 15900:localhost:22 an_account_at_external_server@external_server
the port 15900 is an arbitrary unused/free port on external server.

on the external server, where you have an account as user "an_account_at_external_server", run:
Code:
$ ssh -p 15900 localhost
[prompt on internal server]
voilá !

Last edited by marozsas; 08-22-2008 at 11:19 AM. Reason: ssh port forward
 
Old 08-25-2008, 04:37 AM   #3
G00fy
Member
 
Registered: Jul 2004
Location: Herent, Belgium, Europe, Earth
Distribution: Ubuntu 7.04
Posts: 101

Original Poster
Rep: Reputation: 15
Simple, but beautifull


Thanks !
 
Old 08-25-2008, 09:22 AM   #4
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,121

Rep: Reputation: 121Reputation: 121
Instead of trying to circumvent and bend the rules to gain access, the most ethical thing to do is ask for the port to be opened by the "security guys". If they're competent admins, they'll detect you're bending of the rules and shut you off most likely, then you'll have a harder time convincing them to open the port and ultimately be on their watch and shit list, I'm an admin myself and would frown upon this type of behavior, even prompting to report you to your own supervisor and senior management. Repeat offenders usually got canned.

Now go do the right thing and ask for the access instead of breaking the rules they probably have up for good measure and security reasons.
 
Old 08-25-2008, 09:55 AM   #5
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,382
Blog Entries: 1

Rep: Reputation: 60
yes, good point, and I'm sorry to not warn G00fy before.
I don't want to help anyone to break anything; this forum is not a h@ck3r forum or whatever, even that information is public on the internet and it is a legitimate use of ssh.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
apf blocking all outgoing ssh bytez Linux - Software 1 03-04-2007 02:57 AM
no outgoing ssh connection in subnet with shorewall/squid linux_marine Linux - Networking 2 11-21-2006 02:30 PM
iptables: should I ACCEPT incomming pakets for my outgoing connections? iflorea Linux - Networking 2 08-11-2006 06:51 AM
Fail to accept connection PoorGuy Programming 7 11-04-2004 09:10 AM
SSH doesn't accept connections basse- Linux - Software 1 05-23-2004 07:33 AM


All times are GMT -5. The time now is 05:13 AM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration