It's possible to create a user such that
- Login is possible via command line interface, e.g.
- Login is impossible in GUI, e.g.
- It has password, ideally also has home directory.
In Ubuntu 16.04,
you can configure the
access.conf file according to your needs.
First, create a standard user (without Admin privileges).
Then edit the file
/etc/security/access.conf and add a line that will disallow any local logins except the tty that you will define.
- : localuser : LOCAL EXCEPT tty1
Now we need to activate the access.conf file.
Here is the Trick on how to activate in Ubuntu.
For some reason, when I tested this on my Ubuntu 16.04 configuring the default /etc/pam.d/login file, (the pam_access.so line already exist there, and I just uncommented it) it didn't work.
But it did work when I added the line in
Edit the file and insert the following line below
account required pam_access.so
No restart of any service is needed. Just log out and test if the new user can log in from Lightdm, GDM or any Display Manager you have.