1

I am running a lot of network based processes in my office computer. I want others to switch on my computer in my absence, but I am not ready to share my password. So I have to enable the auto login to my user. But, I also don't want others to see my personal and official documents.

Hence I want to know how to enable screen lock in an auto login Ubuntu system. I am using 16.04 LTS.

I saw a solution in https://askubuntu.com/a/539270. But when I tired this, my system is automatically logging in, but the screen is not locked.

Expecting a solution.

NB: I know how to make auto login. No need to explain it.

Joo Nice
  • 154
  • Is it an option to 'only' switch on your computer in your absence? If your network based processes can run without logging in your userID, you need not be logged in. If you have a server installed, for example openssh-server, you can log in remotely, whenever you want to. – sudodus Apr 07 '18 at 11:31
  • A safer solution is to get a separate computer, install Ubuntu Server, and make it run your network based processes. – sudodus Apr 07 '18 at 12:17
  • See https://askubuntu.com/a/1094340/16395 – Rmano Aug 05 '19 at 13:16

1 Answers1

0

I have modified a solution from https://askubuntu.com/a/539270. Now it works for me.

I added the following command to Startup applications.

gnome-terminal -e 'gnome-screensaver-command -l'

Now after login/autologin the screen is successfully locked. BUT I cannot type the password at the unlock screen. However, I can click "Switch user" button and login from the login screen.

P.S. Please, be sure that you are using GNOME environment. For example, in MATE environment, use

mate-terminal -e 'mate-screensaver-command -l'
Chaosor
  • 373