LinuxQuestions.org
Review your favorite Linux distribution.
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 11-03-2022, 02:38 PM   #1
Jason_25
Member
 
Registered: Nov 2001
Posts: 180

Rep: Reputation: 23
Stop SSH server DNS connections?


I am still seeing connections to the DNS server when I am doing SSH connections on my LAN. This is what I have done to try to fix it:

GSSAPIAuthentication no in sshd_config
UseDNS no in sshd_config
SSHD_OPTS=-u0 in /etc/default/ssh

I cannot express how troublesome SSH has been in setting my network up properly. It is the most unconfigurable software out there.

Because OpenDNS really needs to be aware of exactly how many SSH connections I have open and exactly what I am doing. Very secure.

More people need to crack open a network analyzer and get to work on securing their networks. The idea that this popular software is "leaking" connections and the options literally do nothing is very troubling.

Why even post this? I fix all my own problems anyway. I already know I am going to have to change the SSH server to one that obeys the user's commands. I could even use telnet secured with Stunnel or no Stunnel at all since it is on a separate VLAN on a local network. But in case someone has a fix I am all ears. Someone please give me a fix here so I do not have to spend ever more time on this.
 
Old 11-03-2022, 07:19 PM   #2
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
SSH and DNS are totally different. One does not impact the other except that ssh may need to use dns services to get an ip address if the connection is being made to a hostname instead of directly to the IP address of that host.

Saying that dns needs to know how many ssh connections you have is fubar. Dns does not care anything about connections, it only responds by sending an IP in response to a query by host name.

For example, if you try to make a connection with 'ssh user@hostname' then ssh sends a query to the dns server asking 'what is the ip of hostname'. Dns returns the ip address and ssh then connects to that IP by substituting so the command is effectively 'ssh user@IP'. This is the only way those 2 services interact.

That is not a 'leakage' but is instead a feature that is built into almost everything that allows access to the internet or local network.

Almost all you use on the network requires dns access.

Last edited by computersavvy; 11-03-2022 at 07:21 PM.
 
Old 11-03-2022, 09:01 PM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,311
Blog Entries: 3

Rep: Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722
UseDNS already is set to "no" by default for the server. As mentioned in #2 above, your client will look up target host names.

Which system are you seeing contacting DNS when initiating an SSH connection, the client or the server?
 
Old 11-04-2022, 02:54 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,855

Rep: Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311Reputation: 7311
yes, dns and ssh are two independent things. But when you execute the command: ssh hostname this hostname will be checked in a dns server anyway. This is not ssh, but how the network works. What do you want to achieve?
DNS will not manage ssh connections at all (and has no any idea about any kind of open connections).

I don't really understand what do you mean by leaking connection. Also ssh is a very popular software used by a really huge amount of people and machines, any kind of vulnerabilities will be fixed as soon as possible. If you think you find a problem you need to report it. But first you need to explain what do you mean by that.
 
Old 11-05-2022, 08:13 AM   #5
Jason_25
Member
 
Registered: Nov 2001
Posts: 180

Original Poster
Rep: Reputation: 23
I had some time to address this problem.

First of all, this is a kind of leak because an outside party does not need to know about what you are doing on your internal network. It is not a "full" leak that causes a loss of custody of private data but it is concerning.

The OpenSSH people are not responsive to user problems so things like this do not get addressed. We are not the cryptograhic professionals remember.

I was suprised to see that Dropbear SSH server did the exact same thing with unnecessary DNS connections.

The best way to handle this since this is a server that operates off of IP with really no need for DNS is this:
sudo iptables -A OUTPUT -p udp --destination-port 53 -j DROP
This quiets my monitors down and makes me happy.

I did not get around to using lsh, WolfSSH, telnet-ssl, telnet with stunnel, regular telnet, or nc.
 
Old 11-05-2022, 08:20 AM   #6
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,311
Blog Entries: 3

Rep: Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722
Quote:
Originally Posted by Jason_25 View Post
I had some time to address this problem.
It is unclear whether you mean that it is the client or the server which is doing the lookups. Without that information, no solution is possible. Blocking outgoing 53 for UDP won't block DNS lookups, it also works over TCP. Furthermore, blocking DNS will break a lot of important tools you really need, like NTP.

Can you review the posts above and double check to ensure that you have answered the clarifying questions posed in regards to this thread?
 
Old 11-05-2022, 09:27 AM   #7
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,635

Rep: Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697Reputation: 2697
I have run a local nameserver on my internal network, and used DNSMASQ to cache external lookups. It increases security, slightly improves speed, and reduces DNS traffic going external to my local network.

I think you are obsessing over nothing, but in case you have a real problem this is a real solution.
 
Old 11-05-2022, 09:37 AM   #8
Jason_25
Member
 
Registered: Nov 2001
Posts: 180

Original Poster
Rep: Reputation: 23
Sorry if I was unclear. It is definitely the server doing the lookups and the problem is definitely sufficiently worked around with the iptables trick. There are no more outbound DNS connections after this. I still have the OpenSSH settings applied above so that may play into it. You may have a point on NTP so I will have to see how that works.

DNSmasq may be a solution also. I am not sure it is obsessing if the program is supposed to be totally secure but does unnecessary things which could lead to an insecure situation. As I have said before I am having to put my foot down on this network and I am not going to accept behavior which is counter to what I want to see.
 
  


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
LXer: Complete Tutorial On How To Setup SSH Keys & SSH Connections LXer Syndicated Linux News 0 05-10-2018 12:30 AM
squid drops connections to ip addresses, but allows connections to domain names igoryonya Linux - Networking 4 11-07-2014 05:10 PM
squid drops connections to ip addresses, but allows connections to domain names igoryonya Linux - Networking 2 11-06-2014 10:33 PM
How to set DNS servers? How to stop auto change of DNS servers? newtovanilla Linux - Newbie 1 10-29-2008 09:19 PM
2000 MySQL connections, still "too many connections" newlinuxnewbie Linux - General 0 11-07-2005 01:03 PM

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

All times are GMT -5. The time now is 09:08 AM.

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