Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My computer only has a single user that is used for normal log in.

On boot, it would be convenient of the system would log in that user automatically, and then optionally, lock the screen, such as by launching a password protected screen saver.


share|improve this question

Set your user for automatic login in System Settings -> User Accounts -> Automatic Login (you will need to press the "unlock" button and enter your password before you can change the automatic login setting).

The command gnome-screensaver-command -l will cause the screen to be immediately locked, which can probably be added to your autostart items.

Using gedit (or other text editor of choice), create /home/USERNAME/.config/autostart/screen_lock.desktop with contents:

[Desktop Entry]
Name=Lock Screensaver
Exec=gnome-screensaver-command -l

And hopefully it will automatically login and then lock the screen.

share|improve this answer
Ubuntu 14.04 does not recognize those desktop entries in my case.. – dmeu Aug 3 '15 at 7:40
Checkout how to add a startup script here: – dmeu Aug 3 '15 at 7:52

What you ask is almost a normal setup. During installation you get asked to insert a password and can choose to have that user log in automatically. This image shows the checkbox as off (You can not use automatic log in with an encrypted home).

enter image description here

After install you can still set this at the accounts settings:

enter image description here

The screen lock is by default set to ask for a password. Have a look at this topic for more information: How do I disable the screensaver/lock in 12.04? on where to find it. The setting where you can do this looks like this:

enter image description here

It is about not setting the lock but you just have to set it the other way.

share|improve this answer
With this setup the user will be logged on automatically with their computer unlocked vulnerable to attacks. What OP is asking is how to login and lock the screen automatically at the same time after boot. – denysonique Dec 16 '13 at 20:12
@denysonique he said "optionally lock the screen" so this is a user discussion that can not be automated ;) – Rinzwind Dec 16 '13 at 20:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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