2

I had to move the home directory to a different partition because the old partition is full. Followed this tutorial: https://help.ubuntu.com/community/Partitioning/Home/Moving

I made a mistake when editing the /etc/fstab. I put /mnt/home instead of /home for the mounting point of the new home directory. After rebooting, I cannot connect via SSH, since the public keys are not in /home/ssh. I contacted the server admin, but due to Easter holidays will not hear back until Tuesday.

Any ideas? Thanks!

Ubuntu 16.04.

  • 1
    Do you have any access to the server (remote or physical)? If not you're stuck waiting. – MeetTitan Apr 11 at 7:37
1

Apparently in your situation, not having the authorized_keys file in place, you have no chance to login, if you have disabled password logins in SSH and only rely on public keys and have no alternative account to login in, such as root. So you have to wait for the support team to give you access to the machine.

However if SSH is not your only service running on the machine you have several ways to create an authorized_keys file in your home folder. Here are some ideas:

  1. Use a running FTP / File service and upload a new authorized_keys file in your home directory
  2. If you have Apache with PHP running and a website which let you upload files, try to upload a webshell (like php-web-shell, phpShell, or google php shell) so you get shell access. From there you can try to su to your user and try to fix the wrong mount or at least set a symlink with ln -s /path/wrong /path/right to the correct file or just copy it
  3. even more sophisticated: you can try to remote exploit one of your running services to gain a remote shell access. You can do the same as in step 2.
  4. If it is a virtual server, check the management console. Sometimes you will find also some nice features to manipulate your VM, like uploading or changing configuration.
  5. Do you have service accounts to do stuff from other machines on this server? Try to use their credentials and see what you can do.

The shortcoming of all this is, if you have setup your server securely, all this should not work.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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