LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-01-2019, 04:26 AM   #1
kats99
LQ Newbie
 
Registered: Oct 2019
Location: Bangalore
Distribution: Debian, Slackware, Ubuntu
Posts: 9
Blog Entries: 1

Rep: Reputation: Disabled
How to ssh to another computer using ngrok or similar tools? Basically, using a domain instead of local ip


I'm trying to ssh to my guest machine running Slackware 14.2. I'm able to do it using the local ip but how do I do it with a domain? My host os is Debian 10

uname -a of Slackware
Code:
Linux sandalphon 4.4.14 #2 SMP Fri Jun 24 13:38:27 CDT 2016 x86_64 Intel(R) Core(TM) i5-2430M CPU @ 2.40GHz GenuineIntel GNU/Linux
uname -a of Debian
Code:
Linux sandalphon 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux
 
Old 11-01-2019, 07:15 AM   #2
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,066

Rep: Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338
Quote:
Originally Posted by kats99 View Post
I'm trying to ssh to my guest machine running Slackware 14.2. I'm able to do it using the local ip but how do I do it with a domain? My host os is Debian 10

uname -a of Slackware
Code:
Linux sandalphon 4.4.14 #2 SMP Fri Jun 24 13:38:27 CDT 2016 x86_64 Intel(R) Core(TM) i5-2430M CPU @ 2.40GHz GenuineIntel GNU/Linux
uname -a of Debian
Code:
Linux sandalphon 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux
In the above, do you mean access by Microsoft Domain (running a Windows Active Directory based network
), or FQDN (Fully Qualified Domain Name) involving a host or node name and IP domain?

My first assumption is that you mean the second, since BOTH of the machines you mention are running Linux.

For this case, you have options:
#1 run a nameserver on your network. This does require a hardware platform and some configuration, but has interesting advantages. It is, however, overkill for a network with five machines or less.
#2 populate your HOSTS files (/etc/hosts) with the IP address and names of your machines.

Either of these solutions will allow you to assign names to your machine interfaces so that the names resolve to addresses.

Without knowing the real IP addresses of your hosts I can only provide a rather generic example. If the hosts file contains lines like
Code:
10.0.31.11 debian
10.0.31.12 slack
on BOTH machines then you can go onslack and do
Code:
ssh debian
and expect ssh to attempt connection to 10.0.31.11 automagicly.

Note: do NOT empty the hosts file and replace it with just the two lines. There should be a pair of lines that autopopulate on the networking install that are required for proper operation and should not be deleted. I suggest you make a backup of the file so that you can restore to original conditions at need.

Does that help?

Last edited by wpeckham; 11-01-2019 at 07:18 AM.
 
Old 11-01-2019, 09:20 AM   #3
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, KDE Neon, Arch, Void
Posts: 3,192

Rep: Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998
You also seem to have both hostnames set to the same thing, so even if you had a nameserver, it wouldn't do you any good as there would be conflicts. You need to have unique names in order to connect with hostname/fqdn, unless you do the hosts file as wpeckham suggests.
 
1 members found this post helpful.
Old 11-01-2019, 11:36 AM   #4
kats99
LQ Newbie
 
Registered: Oct 2019
Location: Bangalore
Distribution: Debian, Slackware, Ubuntu
Posts: 9

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Question

Ok now consider it like this. Even if slackware is a virtual machine, it acts like a real machine and so let Slackware be installed on another computer. Now there are two computers Debian and Slackware which are not connected in any way. Now I want to ssh to Slackware from Debian but I cannot do it with the 192.168.x.x ip of Slackware. So, how do I do it? The ip address of Slackware is the same as Debian because it is bridged.

As wpeckham pointed out the two options, neither of them are possible in my case. Even if I set names in the hosts file, how could I connect from debian?
 
Old 11-01-2019, 11:40 AM   #5
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, KDE Neon, Arch, Void
Posts: 3,192

Rep: Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998
If it's using a bridged NIC, the slackware install would get an IP from your DHCP server exactly like it was a physical machine on your network (this is the purpose of bridged network). Sounds more like you're in a NAT'd environment, where your host is providing DHCP services to the guests. This can still work, just requires more setup. You can make it work with a single NAT (I've seen it work like this, never successfully accomplished it myself), but the easier way is to have 2 NAT networks. 1 for the machine to access out, and another to provide only local access to the NAT'd server from the host.
 
Old 11-01-2019, 11:48 AM   #6
kats99
LQ Newbie
 
Registered: Oct 2019
Location: Bangalore
Distribution: Debian, Slackware, Ubuntu
Posts: 9

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Yeah doing it with two NAT'S is easy. Looks like it's not gonna be easy for now. I wonder how people connect to their systems when they are miles away from it? Could that be ssh or a complicated server setup?
 
Old 11-01-2019, 11:57 AM   #7
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, KDE Neon, Arch, Void
Posts: 3,192

Rep: Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998
Getting to it from external systems is easy in a bridge setup. It gets it's own IP on the same subnet as the host, and from an external system, it looks and acts like a separate server, so just ssh to it as normal (this is assuming the firewall on the host has been properly set up to allow inbound connectivity to guests).
 
1 members found this post helpful.
Old 11-02-2019, 06:25 AM   #8
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,066

Rep: Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338
Exactly: everything is easier if (as I did assume in my first answer) each node has a unique IP address. If you have a NATd environment, things are no longer simple.
(Correction: getting from the machine BEHIND the nat out to the rest of the network is simple, getting from outside INTO that node is what is no longer simple.)
There are ways, but I must ask: is there any good reason NOT to change the networking from NAT to bridged?
 
Old 11-02-2019, 06:54 PM   #9
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, KDE Neon, Arch, Void
Posts: 3,192

Rep: Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998
In your environment, possibly not. At my job, we require everyone use NAT'd environements so we don't get a thousand dev VM's showing up on DNS.
 
Old 11-02-2019, 08:56 PM   #10
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,066

Rep: Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338Reputation: 1338
Quote:
Originally Posted by Timothy Miller View Post
In your environment, possibly not. At my job, we require everyone use NAT'd environements so we don't get a thousand dev VM's showing up on DNS.
In mine the GATEWAY is NATd, but virtual machines are all bridged networking. The Internet sees about 8 total external IP addresses , but internally we see EVERYTHING. That makes connecting internal nodes, virtual and native iron, trivial using FQDNs.
 
Old 11-02-2019, 09:55 PM   #11
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, KDE Neon, Arch, Void
Posts: 3,192

Rep: Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998Reputation: 998
Quote:
Originally Posted by wpeckham View Post
In mine the GATEWAY is NATd, but virtual machines are all bridged networking. The Internet sees about 8 total external IP addresses , but internally we see EVERYTHING. That makes connecting internal nodes, virtual and native iron, trivial using FQDNs.
Yeah, the exact opposite of what we want at my job.
 
Old 11-04-2019, 04:23 AM   #12
drgibbon
Member
 
Registered: Nov 2014
Distribution: Slackware64 14.2
Posts: 513

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
Quote:
Originally Posted by kats99 View Post
I wonder how people connect to their systems when they are miles away from it?
Personally I use afraid.org FreeDNS on the SSH server machine, and have a cron job to push any potential IP address changes now and then to afraid.org (there are also some decent tips here on how to secure an SSH server that is exposed to the Internet).

Regarding the ssh connection details, I would just create a profile for the connection in ~/.ssh/config, and do:
Code:
ssh profile_name
HostName (can be an IP, should be static on LAN, if it's remote need DNS anyway), user, port, IdentityFile (key), all of that can be set there.
 
2 members found this post helpful.
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 / ngrok issue achraf12356 Linux - Newbie 0 11-24-2018 07:44 AM
Article: "Newegg: Installing Linux On Your Computer Is Basically The Same As Breaking netherfox Linux Mint 8 06-15-2012 03:42 PM
Postfix - send mail from one local computer to another local computer Runge_Kutta Linux - Software 3 01-09-2010 08:08 AM
Starting x0rfbserver (VNC basically) via SSH deckmoney Linux - Software 0 04-16-2003 05:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:54 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