SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-02-06 13:26:08

Hachiman
#! Member
From: Indianapolis, IN
Registered: 2013-01-18
Posts: 87

[SOLVED] SSH noob question

G'day folks!

Ok, so I'm trying to understand SSH and I'll admit it - I'm having difficulty. I'm very new to this type of thing, and all the stuff I've read is helping - except for one thing: the addresses to be used. If I am out wandering the world with my #! laptop and decide to check the webcam on my #! desktop machine, I understand how to determine my laptop's IP address. But when I start examining my home desktop's IP, there's a bit of confusion. My desktop is connected to the home's router via an ethernet cable, and so has the IP address assigned to it by the router, but if I check it's IP (say using whatsmyip.com) it has a another IP address. So, (hypothetically speaking - these IP addresses are made up) if my laptop has an IP of 10.4.4.4, and the desktop at home has a router-assigned IP of 196.0.0.5 and an 'internet-assigned' IP of 96.10.10.1, what would the syntax of the SSH command in the CLI be?

Oh - and all machines are running #! Statler, in case that's of interest / importance.

Like I said, when it comes to SSH, I'm a total n00b... sorry.  ops

cheers!

Hachiman

Last edited by Hachiman (2013-02-23 21:36:28)

Offline

Be excellent to each other!

#2 2013-02-06 13:49:20

fatmac
#! Die Hard
Registered: 2012-11-14
Posts: 1,948

Re: [SOLVED] SSH noob question

I am not an expert, but I think it would be your 'internet assigned' address, 96.10.10.1 because that looks to me like your router. (??.??.??.1)
(Unroutable addresses 10.0.0.0 & 192.168.0.0 would not be seen on the internet.)

Edit: Best wait until someone better versed in it comes along, sorry.

Last edited by fatmac (2013-02-06 14:09:09)


Linux since 1999
Currently:  AntiX, & Crunchbang.
A good general beginners book for Linux :- http://rute.2038bug.com/index.html.gz
A good Debian read :- http://debian-handbook.info/get/now/

Offline

#3 2013-02-06 14:14:32

Hachiman
#! Member
From: Indianapolis, IN
Registered: 2013-01-18
Posts: 87

Re: [SOLVED] SSH noob question

Thanks for the assistance, fatmac. I should have known that making up an IP address was only going to confuse the issue, 'cause I was bound to make up an address that had a specific purpose!  Would it make a difference if we said the Laptop was xx.xx.xx.xx and the home router was yy.yy.yy.yy and the desktop behind the router was zz.zz.zz.zz? Or am I missing the point?

Offline

#4 2013-02-06 14:15:08

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 13,956

Re: [SOLVED] SSH noob question

Try using sshfs maybe?  That way, you wouldn't need to worry about IP addresses - you just need the host system's name.

Offline

#5 2013-02-06 14:44:50

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: [SOLVED] SSH noob question

To get the ip of any machine, run ifconfig

Then it is just a matter of running ssh username@192.168.1.x  (whatever the ip is)

It will ask for a pw and assign a key and let you connect. 

For auto connecting ssh, pvsages advice of sshfs is solid and what I use for all my networking between linux machines

BTW, connecting with ssh with just the hostname works also

ssh username@hostname

VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

#6 2013-02-06 18:08:55

Hachiman
#! Member
From: Indianapolis, IN
Registered: 2013-01-18
Posts: 87

Re: [SOLVED] SSH noob question

VastOne wrote:

To get the ip of any machine, run ifconfig

Then it is just a matter of running ssh username@192.168.1.x  (whatever the ip is)

It will ask for a pw and assign a key and let you connect. 

For auto connecting ssh, pvsages advice of sshfs is solid and what I use for all my networking between linux machines

BTW, connecting with ssh with just the hostname works also

ssh username@hostname

Does that also apply if you're attempting to SSH from outside your own personal network? If I'm sitting at my local Starbucks and want a file from my home pc, is it still just "ssh username@192.168.1.x" to access my desktop at home?

Offline

#7 2013-02-06 18:15:48

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 998
Website

Re: [SOLVED] SSH noob question

Hi there hachiman,

You're going to want to look into port-forwarding for your router.  That is the process of your router sending certain packets to whatever computer you want it sent to on the internal network.

To give an example.

WAN IP: 100.100.100.100
your ssh machine's internal ip: 192.168.1.100

If you want to connect to that computer from outside your local network, you tell the router to forward port 22 (the standard ssh port) to 192.168.1.100.  When you try to connect to 100.100.100.100 via that port, your router will automatically send the data to the computer you configured.

With port forwarding, you can send certain types of data to any machine on the network with a static IP.

port 80 (http) could go to 192.168.1.100
port 21 (ftp)   could go to 192.168.1.101
port 110 (pop)could go to 192.168.1.102

etc. forever and ever.

Offline

#8 2013-02-06 21:07:19

rockon1215
Member
From: Florida
Registered: 2009-05-30
Posts: 39

Re: [SOLVED] SSH noob question

There are 2 different types of IP addresses. One is for LAN's (192.168.x.x for example) that is used to connect machines that are on the same LAN (duh). This means machines connected to the same router, or (more advanced) a network of routers. Here, the route from device to device doesn't pass through the public internet, but rather the "private" one in your LAN (Local Area Network).

Another is a public ip address that whatismyip.com tells you. This is usually assigned to you by your ISP (Internet Service Provider). This is the address you would use when the device you're trying to connect to isn't currently on the same LAN as the other device. The route from device to device must use the public internet.

SSH will handle both just fine, but the local connection is guaranteed to be faster and will only work if you're connected to that device locally (and all your ports are forwarded and such of course).

Offline

#9 2013-02-06 21:36:21

wuxmedia
wookiee madclaw
From: Back in Blighty
Registered: 2012-03-09
Posts: 1,478
Website

Re: [SOLVED] SSH noob question

just to add some confusion into the mix, if you are wandering the world for any length of time, your ISP may change your IP address, as its (normally) dynamic.
if you have a power cut, you get assigned a new ip, sometimes happens just anyways.

so to fix this, you can go for a free host manager, like www.no-ip.org, this (with some software installed on your server, to track any addrs changes by itself) will give you a name instead of a number...

Offline

#10 2013-02-07 02:08:10

Hachiman
#! Member
From: Indianapolis, IN
Registered: 2013-01-18
Posts: 87

Re: [SOLVED] SSH noob question

Thanks everyone! Because of the excellent advice here, I have been able to successfully log into my desktop via the CLI from my laptop while on my home LAN! I consider this a nice little victory.  smile  I will attempt to do so from an external location next time I'm out-and-about with a laptop.

Thanks again, folks!

Offline

#11 2013-02-07 15:18:12

Hachiman
#! Member
From: Indianapolis, IN
Registered: 2013-01-18
Posts: 87

Re: [SOLVED] SSH noob question

Hachiman wrote:

Thanks everyone! Because of the excellent advice here, I have been able to successfully log into my desktop via the CLI from my laptop while on my home LAN! I consider this a nice little victory.  smile  I will attempt to do so from an external location next time I'm out-and-about with a laptop.

Thanks again, folks!


UPDATE: not having any luck with the remote connection. I am attempting to verify that I'm using the right syntax and right destination IP

Offline

#12 2013-02-07 15:48:47

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 998
Website

Re: [SOLVED] SSH noob question

Did you set up your port forwarding, per my post?  It will never ever ever ever ever ever ever ever work if you don't tell your router to send the SSH port to your PC that's acting as the SSH server.

P.S. Ever.

Offline

#13 2013-02-07 17:17:05

Hachiman
#! Member
From: Indianapolis, IN
Registered: 2013-01-18
Posts: 87

Re: [SOLVED] SSH noob question

schwim wrote:

Did you set up your port forwarding, per my post?  It will never ever ever ever ever ever ever ever work if you don't tell your router to send the SSH port to your PC that's acting as the SSH server.

P.S. Ever.

Oh, yes, Schwim, I did!! I was very careful to set up a reserved IP address on my router for the desktop (and authenticated by the machine's MAC address), and to forward a port to that reserved IP address.

The virtual fly in the ointment is when one tests a SSH connection from behind one's employer's firewall and then wonders what one is doing wrong with the syntax / CLI commands / etc!!   *facepalm*  ops

A short walk to the local Seattle-based-coffee-establishment-with-free-wifi later, and I find that I can connect with my desktop at home perfectly well - when I'm not restricted by a massive corporate firewall!!! Gawd, I am such a n00b! LOL

Thanks for the help, guys. Now I know it works, the next step is to figure out X-forwarding....

cheers!
Hachiman

Offline

#14 2013-02-07 17:20:44

schwim
#! Die Hard
From: Interweb's #1 Devotee
Registered: 2012-10-11
Posts: 998
Website

Re: [SOLVED] SSH noob question

Congrats on getting it going smile

I myself am behind a NAT'ed firewall, so unfortunately am unable to host any of the services from my home.  I'm jealous smile

Offline

#15 2013-02-07 21:52:04

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: [SOLVED] SSH noob question

@Hachiman, great to hear you got it going...

@ Everyone that helped, excellent job!   cool


VSIDO | Words That Build Or Destroy

I dev VSIDO

Offline

#16 2013-02-07 22:02:30

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,749

Re: [SOLVED] SSH noob question

Hachiman wrote:

Thanks for the help, guys. Now I know it works, the next step is to figure out X-forwarding....

ssh -X user@host

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo