LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-20-2003, 03:43 PM   #1
Itzac
Member
 
Registered: Feb 2003
Distribution: VectorLinux 5.1
Posts: 116

Rep: Reputation: 15
Changed my hostname and broke sshd


I changed my hostname yesterday by editting the /etc/sysconfig/network file. I also, for good measure, made similar changes to /etc/hosts. (edit) I've since rebooted my machine.

Now, if I try to ssh into my machine, it says:

Code:
% ssh myname@myboxofwires.net
Connection closed by (my IP)

% ssh myboxofwires.net -l notauser
notauser@myboxofwire.net's password: 
Permission denied (publickey,password,keyboard-interactive).

%
So it will ask for a password from a stranger, but close a legit connection right away. Maybe I missed a step somewhere when changing my hostname. Any thoughts?

Thanks,

Last edited by Itzac; 03-20-2003 at 05:48 PM.
 
Old 03-20-2003, 04:47 PM   #2
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
Quote:
ssh myname@myboxofwires.net
Connection closed by (my IP)
This leads me to believe that your hostname is resolving to the correct ip address. Did you restart all the services that deal with this? This problem is a little vague so it could be a lot of things. Also check your tcpwrappers. Can you deduce anything from the log files(i.e. /var/log/secure)?
 
Old 03-20-2003, 06:28 PM   #3
Itzac
Member
 
Registered: Feb 2003
Distribution: VectorLinux 5.1
Posts: 116

Original Poster
Rep: Reputation: 15
Attempting to connect doesn't seem to generate any messages in /var/log/secure, and things seem to match up from before and after the name change. Are there any other logs or config files I might check? Also how do I check my tcp wrappers?

I did 'ssh -v ...' to a computer I could connect to, and then back to mine. I logged the output and did a diff. The two are almost identical up until the line where the connection is accepted or closed. I'll try refreshing my sshd install.
 
Old 03-20-2003, 06:35 PM   #4
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
hmmm...well tcpwrappers are in /etc/hosts.allow and /etc/hosts.deny . Check your hosts.deny file and see if you are denying access to ssh. I don't think thats the problem though.

Do you have a firewall running?
 
Old 03-20-2003, 07:21 PM   #5
Itzac
Member
 
Registered: Feb 2003
Distribution: VectorLinux 5.1
Posts: 116

Original Poster
Rep: Reputation: 15
Refreshing the install fixed it. I think it may have been something else I did (tried to x-forward xscreensaver) that may have been silly. Thanks for your help though.
 
Old 03-20-2003, 07:26 PM   #6
m0rl0ck
Member
 
Registered: Nov 2002
Distribution: A totally 133t distro :)
Posts: 358

Rep: Reputation: 31
Post the output of:
ssh -v myname@myboxofwires.net

Youll probably have to remove the host keys from the old hostname at least and maybe the user keys too. It might be easier just to move the users .ssh dir to .sshold. That way youd have a backup too.
 
Old 03-20-2003, 08:32 PM   #7
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
Quote:
Refreshing the install fixed it.
What did you do re-install sshd?
 
Old 03-23-2003, 06:54 PM   #8
Itzac
Member
 
Registered: Feb 2003
Distribution: VectorLinux 5.1
Posts: 116

Original Poster
Rep: Reputation: 15
Well, I found the openssl rpms on my install cds and ran
% rpm -Fvh openssl-sshd*.rpm
or whatever the rpm was called.

I rebooted the machine and that seemed to fix it. All is well, now I'm just closing up a few other security holes.

Thanks for all your help
 
  


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
Make sshd answer only on a certain hostname ? michaelsanford Linux - Security 3 07-18-2005 03:19 PM
sshd won't start anymore - hostname? AndK Linux - Newbie 2 04-20-2005 02:10 AM
hostname changed - why? greg108 Fedora 3 12-31-2004 07:41 PM
hostname broke eth0 & dhcp josh18 Linux - Newbie 3 04-16-2004 02:47 AM
broke /bin/hostname nitsky416 Linux - Networking 2 11-30-2003 04:45 AM

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

All times are GMT -5. The time now is 09:25 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
Open Source Consulting | Domain Registration