It may seem impossible to fix a software problem without essential devices, but even in difficult situations, there’s usually a way to fix Linux. Some of the solutions presented in this article require a second computer, but that computer can be anywhere in the world if your Linux computer is connected to the Internet.
By far the easiest problem to fix is running Linux without a mouse. You have several options:
Use the command line. It’s how Linux (and Unix before it) started and it’s capable of even advanced tasks like photo editing, but it’s probably not a good long-term solution for most people. What the command line can do is let you shutdown your computer safely (the
halt command) while you figure out what’s wrong with your mouse.
In Linux, you can always switch to a pseudo-terminal command line using a set of keyboard shortcuts. Unfortunately these keyboard shortcuts recently began to differ on different Linux distributions, so if the first keyboard command below doesn’t work, try the second.
If you run either of the above commands, your entire screen will be taken over by the pseudo-terminal. To get back to graphical Linux, you need to use another keyboard command. Again, these differ on different distributions, so try both:
Use keyboard shortcuts. Often you can perform many tasks using simple keyboard shortcuts. For example, you can quit most programs on Linux by typing
Alt-F followed by
Q. Although you can’t do much this way, you can save any open documents before shutting down the computer safely to fix your mouse.
Use the virtual mouse. If you have a numeric keypad (or a laptop with a numeric keypad mode), you can always use the virtual mouse. To activate the virtual mouse, hold down the Shift key and press the NumLock key—this will turn your numeric keypad into a mouse. Here’s an example of how it works: press
8 to move your mouse up and
6 to move your mouse right. The
5 key will generate a regular left-click, the Plus key will generate a right-click, the
0 key will click-and-hold, and the Decimal Point key will release the hold.
The virtual mouse will let you use Linux as you regularly do until you’re able to fix Linux.
How To Fix Linux Without A Monitor or a Keyboard
When your monitor isn’t working, you can’t see what you’re typing. When your keyboard breaks, you can’t type at all. Either way, in Linux the solutions are usually the same. To fix Linux in this case, you will need to log in to your computer remotely.
You can securely log into your computer remotely using the Secure SHell program (SSH). But before you can login using SSH, you have to install SSH. I suggest you install it before you need it, but I’ll also describe a last-ditch method at the bottom of this article.
Every Linux distribution includes SSH in its package repository. To install it, search your distribution’s package manager for SSH—the packages will probably be named openssh. You need the server package, which will probably be named openssh-server, but it’ll be useful to install the openssh-client package too. After you install them, your distribution will automatically start SSH each time your computer boots.
Warning: SSH will let remote users log into your system if they know your password. Before you install SSH, you should make sure every user on your computer uses a strong password or a hacker could break into your computer.
If you installed both the server and client SSH packages, you can see what SSH looks like right away, just type the following command after substituting your username for user:
SSH will log you into to your computer using a network connection. You should see your typical command line. What’s important is that you’d see this command line even if you were using another computer on the network. To log into your computer remotely, find out its IP address and from another Linux computer type,
ssh firstname.lastname@example.org (replace user and 192.168.1.1 with your username and IP address).
Now that you’ve set up SSH, if your keyboard or monitor breaks, go to another computer and log in remotely using the instructions above.
Last Ditch Way To Fix Linux Without A Mouse, Keyboard, or Monitor
Most older PCs and even laptops used to ship with a serial port (called a COMM port on Windows), but unfortunately this is becoming much less common with USB-based computers. But if you have one of these computers, you should know that Linux automatically runs a pseudo-terminal on any serial ports it finds. You can access this terminal using a special piece of hardware and another computer.
The hardware you need is called a null modem. It doesn’t look like a dial-up modem or a cable or DSL modem—instead the modem is usually built right into a special cord. The null modem lets you connect two serial ports together—for example, your broken computer to a working computer. Null modem cords cost between $5 and $20 at most electronics stores.
You also need special terminal software on your working computer. Older versions of Windows shipped with HyperTerminal, which is adequate for this task. Linux users should install the Minicom terminal.
After installing the software and connecting serial ports on the two computers together, you should be able to create a connection between them. When HyperTerminal or Minicom create the connection, your Linux computer will send you a login prompt—log in as your regular user or as root. You can now fix your problem, but I suggest that you take this opportunity to install SSH and then use it to fix your problem—serial communication runs terribly slow compared to modern networking, and a fast connection will let you fix Linux faster.