2

In case I'm ever raided or realise that I'm being spied upon whilst using my computer, is there a way in Ubuntu I can have a pre-set 'panic button' or series of keys that can log me out or secure my machine?

  • You mean like the "log out" button? – TheWanderer Oct 03 '15 at 13:41
  • Super-L will lock the screen. You can of course just hit the power or reset button on your PC as well, depending on how it's configured. You may need to hold the power button down for a few seconds to power it off. – dobey Oct 03 '15 at 15:26
  • @dobey Yeah, but that needs 6 seconds. If you can do it within 1 second, that's way better. – UTF-8 Oct 03 '15 at 17:36
  • @UTF-8 pull the power cord then. Not that it matters of course. If you don't have full disk encryption, or at least very good home directory encryption, reading your data will be trivial, whether you are logged in or not. If you're that worried about it, making an electromagnet to wipe a traditional hard disk when powered on, isn't that difficult, regardless of OS. And Ubuntu is all open source, so if you want to write code to do something via a kernel module or some other means, it's also very possible. – dobey Oct 03 '15 at 17:42
  • @dobey I'm not that worried about it. I'm on a laptop ... with a built-in battery ... and no HDD. Plus, I'm using home folder encryption and I'm assuming OP does so, too. Otherwise logging out / shutting down really is useless. But shutting down is the best solution for me. I'm not worried about a cold-boot attack. You got to be a hardcore criminal to be worried about that. – UTF-8 Oct 03 '15 at 18:38

2 Answers2

1

If you only want to log out, there is a very quick way of doing it: ctrl + alt + delenter and you're logged out. You don't need to look at any graphical stuff or do anything with your mouse which would take a lot of time which you might not have.

However, I'd recommend shutting the system down to clear your ram, if you're paranoid (which I also recommend). Do do this, set a key combination to gnome-session-quit --power-off. Simply launch "Keyboard" from the dash and switch to the tab "Shortcuts". Under "custom shortcuts" you can ... well ... add a custom shortcut. Use the command stated above and a simple key combination with only 2 keys, so it goes fast.

From then on you can press whatever key combinationarrow leftenter and your machine shuts down. Again, you don't need to look at your screen and see whats happening.

UTF-8
  • 5,710
  • 10
  • 31
  • 67
0

There is something known as magic SYSRQ key. It's usually located on the same key as PRTSC. The typical usage is to safely reboot / power-off the system when it becomes unresponsive.

In particular , holding ALT+SYSRQ and pressing one by one REISUB safely reboots the system.

Holding ALT+SYSRQ and pressing one by one REISUO safely powers-off the system.

Now, if your goal is to abruptly power-off the system , holding ALT+SYSRQ and then pressing O should do the trick, but keep in mind that possible loss of data may occur.

Alternatively you can send SIGKILL to all processes except init with I key or cause a system crash with C

If you want to merely lock the GUI screen, use Super+L shortcut.

If you want to kill your username out of GUI and console session, use killall -u username

If you are concerned about the security, full-disk encryption is probably a thing to consider. Working from a virtualbox OS with encrypted virtual disk is also a thing to consider.

Sergiy Kolodyazhnyy
  • 105,154
  • 20
  • 279
  • 497