5

We are looking for a way to permanently remove the Switch User Account function from our install of Ubuntu Unity. Note, this function appears when you right or left click on the user name in the upper right-hand corner. It then displays a list of 5-10 users that have logged in along with the option to Switch User Account. We know that we can do this by defaulting to gnome, but we would like the option of using Unity as well, but without the Switch User Account option.

We have already tried dconf-editor, gsettings and several other options to remove the users name list, Switch User Account option from appearing in the drop-down list. We know this can be done for one user at a time, but we are wanting to do this for all users on roughly 160 workstations.

Some options that we have already tried are:

This is a visual of what we are trying to remove:

!

jnlickey
  • 73
  • 1
  • 7
  • 1
    I'm not sure if this is what your looking for based on your question, but Ubuntu Tweak has a option that will let you remove the user indicator that you circled in red. – Paul Tanzini Dec 13 '13 at 22:27
  • This is a somewhat messy/incomplete workaround. If you enter the guest account directly from the active account, then exit the guest account, you are able to login to a different user. –  Jan 06 '15 at 18:46

3 Answers3

3

Have you tried editing the /usr/share/glib-2.0/schemas/com.canonical.indicator.session.gschema.xml file simply changing this:

<key type="b" name="user-show-menu">
  <default>true</default>
  <summary>Determine the visibility of the User Menu</summary>
  <description>Allow for the user menu to be hidden by the user.</description>
</key> </code>

to this (true to false):

<key type="b" name="user-show-menu">
  <default>false</default>
  <summary>Determine the visibility of the User Menu</summary>
  <description>Allow for the user menu to be hidden by the user.</description>
</key>

Then make a backup of /usr/share/glib-2.0/schemas/gschemas.compiled Then run

sudo glib-compile-schemas /usr/share/glib-2.0/schemas

Normally this would set it as default for all users.

UPDATE:

Florian Diesch pointed out in the comments that it is better to write an override file, because the .xml could be overwritten in an update, thus or settings will be lost. So instead of directly modifying the gschema.xml make a /usr/share/glib-2.0/schemas/myoverride.gschema.override file with the following contents:

[com.canonical.indicator.session]
user-show-menu=false

The rest is the same: backup and compile.

falconer
  • 15,026
  • 3
  • 48
  • 68
0

This is slightly different in 14.04 Unity (3D):

[apps/indicator-session]
user-show-menu=false

And sysadmins probably want to set it in /etc/dconf, maybe even lock it. See dconf System Administrator Guide for more.

0

Colleague of mine just figured out a workaround for this in Ubuntu 16.04 LTS, by appending the following to /etc/bash.bashrc

gsettings set com.canonical.indicator.session user-show-menu false

This way when any user login occurs the switch user menu does not appear.