I disabled the wrong network interface in the /etc/network/interfaces file on my headless Ubuntu PC. Now I can't ssh into it. I'd need to edit the file again and I don't have a display for that machine right now.

Can I just insert the HDD into another Ubuntu machine and edit the file? I know that I can't boot from that HDD but can I access all the files on it? If yes, do I get into permission troubles once I put the HDD back in the original machine?

  • Yes you can. Just attach the HHD to the other machine, and you shouldn't get permission errors. You are on the right track. – ARG Apr 1 at 20:00

Yes you can put the HDD on a different PC, without problems caused by permissions, as kindly noted above by ARG.

If you have local access to the machine in question, you may also boot from a LiveUSB without removing the HDD from the target PC; most LiveUSBs have all the editing tools required. https://tutorials.ubuntu.com/tutorial/tutorial-create-a-usb-stick-on-ubuntu#0 shows how.

  • Thanks for your answer. How can I edit the network/inerfaces file with a Live USB Ubuntu? Doens't make sense to me if I just have access of the HDD and no Display etc. – hkkdsakddasakdsadsakj Apr 1 at 20:24
  • 1
    Sorry, did not realize the PC in question was headless. LiveUSB is not a solution for headless machines. Have added the headless tag to your question to head off other well meaning folks. – K7AAY Apr 1 at 22:29

You can choose from the following options (the higher the number, the more difficult):

  1. Take the HDD out of the existing machine, plug it into a USB enclosure and plug it into another PC preferably running Ubuntu, then Linux, then FreeBSD, ...

  2. Booting from said HDD it in an identical machine is also no issue.

  3. Inserting it in a Windows machine is possible but more difficult as you need Parragon commercial software.

  4. Booting it on another machine with wildly different hardware could work but might also get you into a lot of trouble.

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.