Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: messed up server

  1. #1
    Join Date
    Mar 2008
    Beans
    34

    messed up server

    hi all,

    i am waiting back for a response from my host, but basically, i have done something majorily stupid.

    i wanted to change the owner and group for files i had transferred from another server, it looks like i changed the details for all files and folder on the server, and now i cannot login to my server via ssh.

    here is what i used to try and changed the details:

    chown -R sml *

    chgrp -R psacln *

    is there any option for me, when i try to login to my server, i get the folowing:

    ssh_exchange_identification: Connection closed by remote host

    appreciate any help.

    thanks

  2. #2
    Join Date
    May 2007
    Location
    Phoenix, Arizona USA
    Beans
    2,909
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: messed up server

    Nope, you're gonna have to have someone boot into single user mode to fix this I'm afraid or log on as root at the con if they can.

    -Tim
    www.pcchopshop.net

    Hard to find and obsolete PC and server parts. "If we can't find it, it probably doesn't exist"

  3. #3
    Join Date
    Mar 2008
    Beans
    34

    Re: messed up server

    thanks for the reply, i have sent several emails to support, can't blame them for not replying, sunday and all.

    i guess there is nothing at i can do, just wait till tomorrow, holding of the angry clients.

    thanks for the advice.

  4. #4
    Join Date
    May 2008
    Location
    Terrace, British Columbia
    Beans
    188

    Question your current working directory?

    Quote Originally Posted by leewilson78 View Post

    chown -R sml *

    chgrp -R psacln *
    What directory where you in when you typed those commands?

  5. #5
    Join Date
    Mar 2008
    Beans
    34

    Re: messed up server

    I cannot be too sure, I have noticed that not all sites have gone down though, and I can still login to some sites via ftp.

    My main site that is associated with the server has gone down though.

  6. #6
    Join Date
    Mar 2008
    Beans
    34

    Re: messed up server

    actually, I stand corrected, I can access the main site. When I look at the owner and group in ftp, I see they are all set to the new owner and group.

  7. #7
    Join Date
    May 2008
    Location
    Terrace, British Columbia
    Beans
    188

    Re: messed up server

    I'm wondering that since you're able to log in by FTP, maybe you can chown the specific files back to normal to repair SSH?

    /var/run/ssh
    and possibly /var/log

    A couple log files that I'd check.
    Code:
    root@server:/var/log# ls -l
    total 4708
    drwxr-x--- 2 root   adm        4096 2008-06-23 06:25 apache2
    drwxr-xr-x 2 root   root       4096 2007-10-13 18:32 apparmor
    drwxr-xr-x 2 root   root       4096 2008-06-01 06:25 apt
    drwxr-xr-x 4 root   root       4096 2008-02-28 13:43 asterisk
    -rw-r----- 1 syslog adm      124286 2008-06-29 03:28 auth.log
    -rw-r----- 1 root   adm          31 2007-11-06 07:41 boot
    -rw-rw-r-- 1 root   utmp          0 2008-06-01 06:25 btmp
    -rw-r----- 1 syslog adm       15156 2008-06-29 02:04 daemon.log
    -rw-r----- 1 syslog adm      168410 2008-06-25 14:49 debug
    drwxr-xr-x 2 root   root       4096 2007-10-13 18:09 dist-upgrade
    -rw-r----- 1 root   adm       30822 2008-06-25 10:56 dmesg
    -rw-r----- 1 root   adm       14199 2008-06-19 02:08 dpkg.log
    -rw-r--r-- 1 root   root      32032 2008-05-08 13:44 faillog
    drwxr-xr-x 2 root   root       4096 2007-11-06 07:41 fsck
    drwxr-xr-x 3 root   root       4096 2007-11-06 08:09 installer
    -rw-r----- 1 syslog adm      207238 2008-06-25 14:49 kern.log
    -rw-rw-r-- 1 root   utmp     292292 2008-06-29 03:28 lastlog
    -rw-r----- 1 syslog adm       56358 2008-06-29 03:19 messages
    -rw-r----- 1 syslog adm       11683 2008-06-29 03:17 syslog
    -rw-r--r-- 1 root   root     328527 2008-06-25 10:56 udev
    -rw-r----- 1 syslog adm           0 2007-11-06 07:42 user.log
    -rw-rw-r-- 1 root   utmp      65280 2008-06-29 03:28 wtmp
    Also check permissions in /etc
    Last edited by promodus; June 29th, 2008 at 11:33 AM.

  8. #8
    Join Date
    Mar 2008
    Beans
    34

    Re: messed up server

    I can login via ftp to specific accounts only, I cannot login via root (SFTP), when I try to, my FTP program gives the following error:

    I/O Error: Connection failed. There was a problem connecting

    There is no option in my FTP program to change the owner of a folder also.

    Thanks
    Last edited by leewilson78; June 29th, 2008 at 11:56 AM.

  9. #9
    Join Date
    May 2008
    Location
    Terrace, British Columbia
    Beans
    188

    Re: messed up server

    I'm thinking if you're able to ftp to this machine with the user you chown'd the files to sml possibly chown back.

    Most daemons will not let you log in via root, as root is common with every Unix. Not to mention the privilege associated. Also, when traversing logs it's easier to see that user sml became root, rather than someone logged in as root and not knowing who.

    What FTP Daemon are you using?

    Any other services on this box?

    Maybe you could use PHP to run a system command.
    i.e. have PHP chown the files, or have php run another instance of SSH from a different configuration file... A temporary backdoor.
    Last edited by promodus; June 29th, 2008 at 12:13 PM.

  10. #10
    Join Date
    Mar 2008
    Beans
    34

    Re: messed up server

    I have managed to login to the server via a remote console that my hosting co. provides.

    I guess there is no command to 'roll back' the system, should I manually change the owner and group of all files?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •