0
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
root@Rx:~#

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

dukevin
  • 1,610
  • 3
  • 18
  • 25

1 Answers1

-2

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

dukevin
  • 1,610
  • 3
  • 18
  • 25
  • 4
    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
  • 1
    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 – dukevin May 24 '12 at 22:54
  • 1
    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 – dukevin May 24 '12 at 22:57
  • Uh, you realize that directories need executable rights, yes? – Magellan May 24 '12 at 22:57
  • @Adrian what should I set the mode to then? I can't turn up anything on google – dukevin May 24 '12 at 22:59
  • That's because you're failing to understand that you have to check everything. /var is used by nearly EVERYTHING on your system. Check with dpkg and see if it will allow you do to a file-level check against the defaults included with each .deb package to see if it will verify the /var file permissions validity. – Magellan May 24 '12 at 23:17
  • Edited answer: chmod 755 is way better than 600 and fixes most of the issues. Manually had to change mode on a few others. – dukevin May 25 '12 at 03:01