Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

How can i prevent/restrict standard users from accessing terminal in ubuntu-12.04.2-desktop-i386 ?

I need to prevent standard users and administrators(not root account) in Ubuntu user accounts from accessing terminal.I am doing a R&D for "ubuntu Desktop management"that is to be done through our Network monitoring software

share|improve this question
... What's wrong with using the terminal? – Ignacio Vazquez-Abrams Jul 3 '13 at 9:15
up vote 4 down vote accepted

If you are looking to ban users that you allow to log in from using a terminal for security reasons, it does not make much sense. "The Terminal" is a tool that will allow you to perform certain actions that you have rights to do. If you take away the right to run "the terminal" (which is actually just another program), the right to perform these actions is not taken away. A user could simply run another program (downloaded?) to perform these actions.

Now if you want to block other users (non-standard I would call them) from loging in at all (be it via the normal method, or via 'the terminal'), you could change the shell line in /etc/passwd to something like /sbin/nologin: this user will not be able to log in.

Example (I can't stress enough that this is probably not what you want for normal users, but it is the only way I can see use for the question. proceed with care)


I'm currently using /bin/false instead of nologin it seems, but that's how it looks

As @gertvdijk mentions in the comments, you could (should?) do this with the chsh (CHange SHell) command like so:

$ sudo chsh -s /usr/sbin/nologin username
share|improve this answer
Which line in /etc/passwd are you talking about? I don't have any line in /etc/passwd named shell – i08in Jul 3 '13 at 9:20
I understand what you meant.I need to do implement desktop policy for Ubuntu desktops in our company – rishab v Jul 3 '13 at 9:21
Be aware that editing this line is NOT applicable for regular users. You would do that for the users like www-data that should never be used to log in. – Nanne Jul 3 '13 at 9:23
It's working fine,Thank you – rishab v Jul 3 '13 at 10:05
That's great. If you can, add the reasons or some more explanation to your question: it will be better for future googlers. Also, if this works, consider accepting it as a valid answer (use the checkmark) and/or give it an upvote. – Nanne Jul 3 '13 at 10:08

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.