Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Slackware 12 Kernel 2.6.24 - probably upgraded by now
Posts: 1,054
Rep:
do both of you have ipv4 addresses ? or are both of you behind a NAT (with an ip like 10.* or 192.* or 172.* etc.)
in the first case it is easily directly possible
in the other case it is a little involved ... I haven't done this myself but I think it would involve you setting up a port forward rule at the router .
if you mean the ip address of the computer itself (not the networks ip address) then i think we haven something like 192.* (but i'm not sure about my friend).
If you want to connect to your friends computer, you will need to know his internet IP address. If he is behind a NAT router, then port 22 needs to be forwarded to his computer. This is done in the computer setup. He needs to be running the sshd daemon and have port 22 open on the computers firewall. If you are the only person who would be logging in with ssh, I'd recommend the "AllowUsers <yourusername>" option. Your friend might consider changing the port number used for ssh as well.
Having port 22 open on the router, hackers will start banging on it trying different username/password combinations. You might consider using public key authentication instead of username/password authentication.
Having port 22 open on the router, hackers will start banging on it trying different username/password combinations. You might consider using public key authentication instead of username/password authentication.
It is also possible to chose an other port isn't it?
But when the port is open, which options doe i have to give to the standard ssh command?
Distribution: Red Hat CentOS Ubuntu FreeBSD OpenSuSe
Posts: 252
Rep:
Quote:
Originally Posted by konqi
It is also possible to chose an other port isn't it?
But when the port is open, which options doe i have to give to the standard ssh command?
Yes it can be change, but I think the issue here is an SSH connection between two different segments. If both are on different NAT, the problem here is the route.
Distribution: Red Hat CentOS Ubuntu FreeBSD OpenSuSe
Posts: 252
Rep:
Quote:
Originally Posted by konqi
It is also possible to chose an other port isn't it?
But when the port is open, which options doe i have to give to the standard ssh command?
If you know the IP address of your friend, check first if you can ping the machine, then do a traceroute, if the trace is complete, then there's no problem on the ssh connection. check first the network.
Yes it can be change, but I think the issue here is an SSH connection between two different segments. If both are on different NAT, the problem here is the route.
There is no problem, i just don't know how to ssh to another computer in another network.
But to i just have to use the ip address of the network by my friend, but how can i reach a comoputer inside that network?
No, I think the 82.156.2.343 address is the address of your friends computer. However if your friend has an ip address in the 192.168.*.* range, this is when you will use his router ip instead
Code:
ssh user@router_ip
Just make sure, like everyone has said, that port 22 is forwarded to his computer on the router.
As for usernames, he will have to make you an account on his box. So your username must exist in /etc/passwd
well 82.156.2.343 is a WLAN address, the external IP that is assigned to you by your ISP. Even if your ISP doesn't provide a truly static IP, on cable broadbands it doesn't change very often. Mine hasn't changed in almost a year. You can check this IP using a lot of websites (just google "what's my ip" etc.) This has nothing to do with your internal LAN IP, which usually is 192.x.x.x. which is assigned to a particular computer. I've got my IP address something like 83.x.x.x. (this is assigned by your ISP) Then I configured each of my computers to have a static IP eg. 192.168.1.100, 192.168.1.106, etc. At the moment I'm not at home but I can access my running computer through ssh because I configured my router to forward port 22 to 192.168.1.103 (which is a computer that is running at the moment)
Similarly, my Network Attached Storage device which is also connected to my router can be accessible because it is kind of an ftp server. And we know that ftp traditionally uses port 21 so I forwarded port 21 to 192.168.1.109 (which is the LAN ip address of this network drive/server. So whenever a packet is send to my modem (at 83.x.x.x) is then passed to my router and here it depends, if the packet uses port 22 it is directed to 192.168.1.103 (a running computer) if the packet uses port 21 (ftp) it goes to my NAS.
Well, I'm not an expert but that's how I understand it and it works. Perhaps, some more experienced members may correct some points.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.