LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-11-2018, 01:36 PM   #1
hnasr2001
Member
 
Registered: Nov 2012
Posts: 98

Rep: Reputation: Disabled
port forwarding in linux


Hi;

I have a computer belong to a private network behind a router. Router has been setup for port forwarding (input port is 6522 and target port is 22)

What would be the ssh command to connect from mypc@mypc to the one in the private network private@private?
 
Old 01-11-2018, 05:43 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,704

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Code:
ssh -p 6522 username@public_IP_address
The private computer should be configured with a static IP address or use the router's DHCP address reservation so it is always assigned the same IP address. Will let others explain security by obscurity and how just changing port numbers will not really make your system more secure.
 
1 members found this post helpful.
Old 01-18-2018, 08:33 AM   #3
hnasr2001
Member
 
Registered: Nov 2012
Posts: 98

Original Poster
Rep: Reputation: Disabled
Thank you.

If I want to use the "scp" command, will the command be :


scp -p 6522 username@public_IP_address ?
 
Old 01-18-2018, 08:58 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,704

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Take a look at the man page for scp syntax. It uses -P instead of -p to specify the port number. You also need to specify the source and destination directories and files to be copied.
 
1 members found this post helpful.
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] IPtables : ssh port forwarding one port to another port issue routers Linux - Networking 7 08-07-2018 08:41 AM
Redirec port in device eth0 to port+ip in device wlan0 ( port forwarding on hostpd wireless network) MattFly Linux - Networking 2 08-28-2016 07:21 PM
Shorewall: port forwarding problem, port is closed even after forwarding Synt4x_3rr0r Linux - Networking 2 12-13-2009 04:36 PM
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 12:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:59 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
Open Source Consulting | Domain Registration