Connecting using SSH in WAN network

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Connecting using SSH in WAN network
# 1  
Old 03-09-2017
Linux Connecting using SSH in WAN network

i have been learning linux from some time for linux plus exam and learned SSH protocol and have practised to connect to remote computer within Lan network and able to sucesssfully connect it .
using
Code:
ssh username@hostname

But i wish to ask how do i use same ssh protocol to connect to other linux computer on other part of world ie in WAN
# 2  
Old 03-09-2017
Hi,

You do it exactly the same way. The ssh command itself doesn't care what or where a host is, it will just try to connect to it. So long as the hostname you use can be resolved, or you're using an IP address, there shouldn't be any issues.

Now, other things may very well stop you from connecting of course. You might have no route to the destination network, a local firewall that blocks the outbound connection, a remote firewall that blocks the inbound connection, etc, etc. Any number of things could get in the way.

But in terms of the ssh command itself, there's no difference in how you connect to a host on your own LAN or on some other network entirely.
This User Gave Thanks to drysdalk For This Post:
# 3  
Old 03-09-2017
The syntax is the same. There are network setups for security that may prevent this, but that is beyond the scope of what you are asking.
This User Gave Thanks to jim mcnamara For This Post:
# 4  
Old 03-09-2017
thank you guys. finding my hostname or local ip address of system within LAN network is quite easy through
Code:
ifconfig

. but i cannot use that physical address of LAN network to connect to other network that pass through Router. So can u guys give me how should i go about it ..
# 5  
Old 03-09-2017
Hi,

I'm sorry, I don't understand. As long as you know the hostname or IP address of the server you want to connect to, then you don't need to know anything else. It's got nothing to do with your own hostname or IP address at all. Connecting to a remote system only needs you to know the details of the remote system.

For example, if you wanted to connect to a host called server.acme.com as the user jsmith, you would simply type:

and that would be that.
# 6  
Old 03-10-2017
Thanks for your patience . my idea is to connect my computer from england to my friend computer in USA. both are pc with linux os installed and connected to internet. how can i find the hostname or ip address of my friend computer in usa.
# 7  
Old 03-10-2017
Hi,

To connect to your friends computer in the USA should be quite simple, if your friend cooperates with you.

However there are a number of things that you must know and a number of things that you must setup at both ends of the link.

You need to know the IP Address or name of the computer that you are trying to connect to - you can generally find this by visiting "whatsmyip" or a similar service - please note it will be your friend that will have to provide you with this information.

Your friend will have also have to have a fixed IP Address or use one of the dynamic dns services as the target IP Address will likely change from time to time.

The remote end will also have to have the appropriate ports open (22 in the case of ssh) or port forwarding or some protocol like NAT (Network Address Translation) setup.

At your end you will also have to have the correct settings for your router, firewall etc.

Regards

Gull04

Last edited by gull04; 03-10-2017 at 03:35 AM.. Reason: Spelling Mistake
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Connecting using ssh

We have 2 different servers say A and B and I want to check the log file of 2 servers simultaneously. If I am logged into server A how can I connect to server B. I have used ssh username@B.But it is asking password. How can I give the password on ssh. Or is there any other utility for... (2 Replies)
Discussion started by: jim john
2 Replies

2. IP Networking

2 WAN connections on 1 switch/network

I want to know potential problems with the following scenario OR if it is an ok way to have my network setup: I have 2 WAN connections to the internet. I have each WAN connection plugged into its own router. Router DD-WRT is gateway for servers (192.0.10.50). Router Tomato is gateway for pc's... (1 Reply)
Discussion started by: herot
1 Replies

3. Linux

connecting to SSH

Well im on Fedora, and theres no sub section for Fedora so yea Well how do you connect to an SSH, while on a windows terminal? And also to transfer a file from my desktop to a server? how is this done scp command is not working for me (3 Replies)
Discussion started by: gangsta
3 Replies

4. Shell Programming and Scripting

connecting to network, auto-entering info

Hey guys, I just started college a few days ago. To my dismay, my school has a very frustrating wireless network access system. Every time you want to use the network, you need to open up a browser and get re-directed to a login page. Every access, you need to reenter the same username and... (1 Reply)
Discussion started by: Chain Breaker
1 Replies

5. IP Networking

Connecting to DHCP network with Realtek interface

I have a Realtek 8139 interface in one of my machines and it will not connect to the network. /etc/rc.conf contains ifconfig_rl0="DHCP" and "rl0" was obtained from a dmesg. A network interface restart yields the following: # /etc/rc.d/netif restart Stopping network: lo0 rl0 fwe0 plip0. rl0: no... (3 Replies)
Discussion started by: figaro
3 Replies

6. IP Networking

ssh server is attachable from local network not from another network

hello i have a ubuntu ssh server that i can acess from any of my comnputers but only if they are on the same wireless network as the server. i tested trhis my tehtehring my samsung blackjack to my windows partition and installing openssh to windows it works when windows is on the wireless but no... (1 Reply)
Discussion started by: old noob
1 Replies

7. IP Networking

Connecting to an SSN from an internal network

Hi I have an Apache Web server running on a Solaris 8 box that sits on a SSN. I have one desktop that connects to the SSN from the internal network and is recognised directly without using the gateway, all other desktops, laptops from inside the internal network connect to the SSN using the... (0 Replies)
Discussion started by: Bobby76
0 Replies

8. HP-UX

Connecting To An External Network Using A logical (PACKAGE) IP Address

Hie everyone, I am currently facing a problem whereby I can not connect to an external network from a package ip address on a HP-UX cluster. Below is the illustration: Primary Server IP Address : n.n.n.202 Secondary Server IP Address : n.n.n.212 Package IP Address : n.n.n.211 ... (1 Reply)
Discussion started by: cchilenga
1 Replies

9. Solaris

Connecting Solaris to Airport network

Hi, I've been trying to find out for the past two days how to set my Solaris 10 to join wireless network (Airport base station with ACL and wep or wpa on). Using ethernet is a bit out of question as I don't have an ethernet cable that would reach the other side of the house. Solaris 10... (1 Reply)
Discussion started by: giax
1 Replies

10. Solaris

Problems connecting Solaris 10 to network via ISP

I have just installed Solaris 10 (x86) on my PC, which is connected to an ISP via a Netgear DG834G firewall/modem router. I can't find the network. My router has the IP address 192.168.0.1 and my ISP assigned IP address is 214.159.X.Y I have edited various files based upon information I have... (7 Replies)
Discussion started by: christian_hicks
7 Replies
Login or Register to Ask a Question