LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-25-2011, 11:30 AM   #1
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,027

Rep: Reputation: 69
How can I do the following...


My cousin goes to college here in the US. He runs CentOS 5.4 and needs some help configuring things. So I'd like to help remotely. I've been thinking of ways on how to do this. I need some sort of reverse shell. I was hoping to find something with SSH. Obviously since he's behind a NAT router he can't simply have sshd running and them connecting to it. He doesn't have access to the NAT router to place a port forwarding rule. And it's not like he can ssh into my box because I need to configure his computer.

Does SSH have any option for somehow maybe forwarding a shell when he connects to my box on SSH?

The only other thing I can think of is to have netcat listening on my computer and have him run netcat and forward his shell. nc myip port -e /bin/bash. Any other ideas?
 
Old 04-25-2011, 11:38 AM   #2
Person_1873
Member
 
Registered: Sep 2007
Location: Australia
Distribution: Arch Linux
Posts: 496

Rep: Reputation: 40
ssh has the ability to tunnel ports, maybe he could tunnel to your port 443 and then you could connect using localhost:443
 
Old 04-25-2011, 11:39 AM   #3
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

If you completely control your router and machine you can allow him to set up a reverse ssh tunnel from his machine to yours. Configure your router to allow SSH, create a user account for him on your computer, tell him to run the following:
Code:
ssh -R 1234:localhost:22 your_IP
That way he doesn't have to change anything and you can login to his computer by executing:
Code:
ssh hisuser@localhost -p 1234
He will have to keep the session open for you to be able to connect. If he closes his terminal, your session will be disconnected. If you want to overcome that you can use a tool like AutoSSH that will keep the tunnel alive (needs key based authentication to automatically login).
If you want to take it a bit further you can also set up key based authentication between the two computers.

If you don't want to go through the trouble of setting this up, you could also use TeamViewer.

Hope that helps.

Kind regards,

Eric
 
1 members found this post helpful.
Old 04-25-2011, 11:43 AM   #4
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,027

Original Poster
Rep: Reputation: 69
Fantastic I will try these out, thanks.
 
Old 04-25-2011, 11:55 AM   #5
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hi,

Great! Let us know how it goes. Have fun with Linux.

Kind regards,

Eric
 
  


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




All times are GMT -5. The time now is 04:19 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration