Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
root@Rx:~# ssh -v root@[ip]
OpenSSH_5.5p1 Debian-6+squeeze1, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to [ip] [ip] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: identity file /root/.ssh/id_dsa-cert type -1
ssh_exchange_identification: Connection closed by remote host

Randomly couldn't connect to my VPS, it was working literally hours ago, and I haven't done anything out of the ordinary. What would be the most likely problem?

Edit: I do remember accidentally doing sudo chmod -R 777 /var/. According to the second answer on ssh_exchange_identification: Connection closed by remote host /var/log/btmp should be 600, but I do not have btmp in my /var/log dir

share|improve this question
up vote -2 down vote accepted

I accidentally did chmod 777 -R on /var/.

Was able to connect again by doing chmod 755 -R /var/ There are still some abnormalities so those I had to manually change the mode

share|improve this answer
then we can probably expect more questions from you about all the other stuff you just broke with chmod 600 :) – stew May 24 '12 at 22:46
chmod 600 -R /var/ <- ouch :( – EightBitTony May 24 '12 at 22:52
@stew Care to show what I broke or how to fix it? I tried googling what the mode of everything in /var/ should be but I couldn't find anything – Kevin Duke May 24 '12 at 22:54
Yes, you did a recursively (meaning to all child folders and files) changed the files in your directory to be only readable and writable by their owners. Only fervent prayers to the deity of your choice will be assured of fixing everything you just broke. – Magellan May 24 '12 at 22:56
@Adrian I already broke everything with 777, at least this way I can access the vps and attempt to fix – Kevin Duke May 24 '12 at 22:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.