Force ssl/ssh to use the hosts file

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Force ssl/ssh to use the hosts file
# 1  
Old 04-08-2014
Force ssl/ssh to use the hosts file

does anyone know how to force ssh/ssl to use the hosts file instead of DNS? I have disabled the DNS servers but ssh still will not resolve a host in the hosts file.

thanks in advance for the help!

DS
# 2  
Old 04-08-2014
Not sure what OS you're using, but if available, you could set the nsswitch.conf file to default to files (meaning /etc/hosts) and then dns:

Code:
Comment out these lines if they exists:
hosts:          dns files
hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4

And replace with this line:
hosts:          files dns

# 3  
Old 04-08-2014
RHEL 6.5

nsswitch is set to files dns

it will eventually resolve to the hosts file, but it takes about a minute to do so.

thanks!
DS
# 4  
Old 04-15-2014
Inside [CODE] and [/CODE] tags, an you paste the contents of /etc/nsswitch.conf and /etc/resolv.conf so we can look at all the settings. It sounds to me like you are still going DNS first and there is a problem on the DNS servers. I assume that the name you are using is not in DNS, but the DNS should recognise it and return a "not found" sort of response much faster.

Do you have multiple DNS servers and is one broken? Can you do the following to each configured DNS server IP:-
Code:
nslookup known.good.name dns.server.ip.address

Do you get a response in a suitable time? It is possible that you need to adjust your time-out values for your DNS query. There are different ways of implementing the TIMEOUT and RETRY values so you get a sensible response.


Regards,
Robin

Last edited by rbatte1; 04-15-2014 at 06:28 AM.. Reason: Ooops, didn't spot that the OS and version were already given.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How to copy a tar file on a series of remote hosts and untar it on those hosts?

Am trying to copy a tar file onto a series of remote hosts and untar it at the destination. Need to do this without having to do multiple ssh. Actions to perform within a single ssh session via shell script - copy a file - untar at destination (remote host) OS : Linux RHEL6 (3 Replies)
Discussion started by: sankasu
3 Replies

2. IP Networking

Force SSH session without/disabling X11 forwarding.

I would like to disable X11 session forcefully. I have tried the following things: 1. Setting appropriate DISPLAY variable in the /etc/environment file to be "0.0" 2. I have tried setting the sshd_config parameter X11Forwarding to be "no" This session communication is happening by exchanging... (2 Replies)
Discussion started by: vaibhavvsk
2 Replies

3. IP Networking

Force routing between three hosts

Hi, I'm having problem trying to create the following scenario: VM1 <--> VM2 <--> VM3 where VM1, VM2 and VM3 are virtual machines and VM1 and VM3 have to pass trough VM2 to "talk" each other. The best solution should be change the default gateway of VM1 and VM3 by pointing it to VM2... (4 Replies)
Discussion started by: mcanonic
4 Replies

4. Shell Programming and Scripting

Ssh to 100s of hosts with password in a shell script or text file

I have about 500 hosts where I need to ssh by sending the password on the command line or in a text file in a clear text . However I am not able to download "sshpass" or other tools . Any other ways to pass the password in a script ? (3 Replies)
Discussion started by: gubbu
3 Replies

5. Shell Programming and Scripting

ssh key based authentication - force

Hi Team, we have problem with sftp. Though SA team has setup the keys between 2 server, sftp still prompts for the password. After many attempt to rectify the problem, SA has asked us force the SSH key based authentication by using following command. sftp2 --indetity="folder/private_key"... (6 Replies)
Discussion started by: ace_friends22
6 Replies

6. UNIX for Dummies Questions & Answers

Setting up VSFTPD (force SSL?)

Hi all, Im having trouble setting up an FTP server and forcing SSL. At the moment i can connect to the server externally using normal FTP but when i try FTP with SSL i get STATUS:> Connected. Exchanging encryption keys... ERROR:> SSL: Error in negotiating... (5 Replies)
Discussion started by: mokachoka
5 Replies

7. UNIX for Dummies Questions & Answers

Force user to use ssh/prevent telnet access

I have just set up a user on our system HP-Thru64. The user needs to be able to su to root after they login and this works fine. Users cannot login from root externally so you have to first connect as a user and then su. I am wondering is it possible for me to prevent the user from having telnet... (4 Replies)
Discussion started by: peragin
4 Replies

8. UNIX for Dummies Questions & Answers

SSH/SSL wrapper

My IRC client does not support SSL, so I was wondering if there was any other way to encrypt the information between SSL clients on an IRC network, maybe by using SSH to enter the IRC program or something (it's a command-line program) and passing all the plain-text through SSH first. I tried... (0 Replies)
Discussion started by: guitarscn
0 Replies

9. AIX

/etc/hosts via ssh

Hi, I want to change the /etc/hosts file on the hmc. I am connecting via ssh but any vi command is not allowed. Can someone please let me know how to do this? Many Thanks. Kees (23 Replies)
Discussion started by: KeesH
23 Replies

10. Shell Programming and Scripting

How to setup SSH between 4 hosts ?

Hi, I logged into h0011awe server. I am executing a script on this server which connects to other 3 hosts (h0022sam, h0033jar, h0044orc). In the script the command are like this orapmon=`ssh $USR@$host ps -ef|grep -v grep|grep pmon` I am using secured shell. How to setup that between these... (2 Replies)
Discussion started by: dreams5617
2 Replies
Login or Register to Ask a Question