32

Lollipop has put an emphasis on multiple users, which is just irksome on a personal phone. I don't need a guest account and I don't need a bright blue user icon reminding me I could be someone else.

I've disabled adding a guest from the lock screen (really a sensible default?!), and I've logged in as guest, pulled down and clicked "Remove Guest". But back in my normal account I still see the guest account icon when I pull down the top bar and click the blue user thing.

Is there a way to completely disable the guest feature?

2

6 Answers 6

45
+50

Edit: Firstly, please follow the answer here. It offers an easier approach and is tested with Android 7.1.1.


Some users have reported that the following solution didn't work for Android Marshmallow and above. That may be so since I tested this with Android Lollipop and worked well on it.


Yes and No! It depends upon how you want to use this answer.

I still see the guest account icon when I pull down the top bar and click the blue user thing.

You don't need to go that far by completely disabling the guest user to avoid that guest account icon when you pull down the top bar and click your profile image. All you've to do is remove all other users from Settings → Users and change the value of a key.

The key is guest_user_enabled under the table global found at /data/data/com.android.providers.settings/databases/settings.db. This database belongs to Settings Storage app. Its current value would be 1. Change it to 0 using with the command:

adb shell settings put global guest_user_enabled 0

Changes should take place immediately, otherwise, simply restart the phone.

Now, whenever you would tap your profile image in the top bar you would see the profile contact (if already created) or a toast saying "The contact doesn't exist". That icon wouldn't show itself as long as you don't create any more users.

Note: As noted above, it is important to remove all other users since the said method wouldn't work as long as any secondary user remains in the system.


The aforesaid technique simply deals with the nuisance that icon is to some users. It doesn't restrict the primary user (owner) to switch or create new user from Settings → Users.

What if I'm happy with having a single user (me) and don't want to see that User in the Settings?

That would require root access. There are devices under the banner Android One which are now running Android Lollipop yet do not have multi-user functionality. It turned out that the [multi-user] feature is disabled (the feature is disabled using framework as noted here) [can be enabled] using few entries in build.prop. Why not use that technique for our advantage?

Hide Users from Settings

  1. Install a file manager with root explorer feature or a build prop editor app.
  2. The location of build.prop is /system/build.prop. Open the file, go to the end, create a new line and enter fw.show_multiuserui=0.
  3. Reboot the device.

Go to Settings and you would notice that Users entry is missing. As a side-effect, the result in first section i.e. the removal of the guest icon is also covered by this solution.

The good part is that while guest/secondary user is nowhere to be found which you can switch to using GUI, you can still use that multi-user feature. adb shell am switch-user USER_ID can switch the user easily provided that you know the USER_ID of the guest/secondary user which you can obtain from /data/system/users/.

On the other hand, adb shell pm create-user USER_NAME can create a new user too. All good here.


What if I don't feel the need to have my device being used by a secondary user at all? I don't want multi-user functionality in my device?

That can be done. Thanks to Android One technique.

Remove multi-user feature

We're not removing the feature from the system but simply restricting the system to a single user. As mentioned in the last section, we need to edit build.prop which requires root access.

Add fw.max_users=1 in build.prop and restart the device. This would restrict the system from creating any new user since the maximum user is set to one. It would also hide the entry Users from Settings as well as the guest user icon aka the nuisance.

Note that you can always switch to the guest/secondary accounts using adb shell am switch-user USER_ID even after restricting the maximum users to one since the restriction is set to curb further creation of the users. If you feel the need to remove those users but find it bit problematic that there is no option now to remove them from GUI, then simply do adb shell pm remove-user USER_ID.

13
  • 2
    Superb answer. fw.max_users=1 worked for me. I was looking for this after accidentally logging in as a guest while the phone was in my pocket, and having a moment of extreme panic while I thought I had accidentally done a hard reset on my device!
    – Mark Ch
    Commented Oct 9, 2015 at 6:06
  • 1
    Followed every step here on Cyanogenmod 13 (Android 6.0), still get the little blue user switch icon in the top right of the lock screen. Except now it prompts me to add a new contact.
    – detly
    Commented Jun 5, 2016 at 12:41
  • 1
    @Firelord I figured it was something like that, so I didn't downvote. If I find out how to do it on M, I'll add something to your answer.
    – detly
    Commented Jun 5, 2016 at 23:16
  • 1
    The first option with ADB shell does not seems to work on Nougat.
    – Sylveon
    Commented Jul 20, 2017 at 3:24
  • 2
    @arnuschky When I wrote this answer I had Lollipop only, and Nougat or Marshmallow were not released, so I don't think the answer is incorrect, it just doesn't apply on newer versions of Android.
    – Firelord
    Commented Aug 21, 2017 at 12:42
11

To remove guest user from android device follow this link

This simply says that you have to enter into guest account then from settings -> users -> remove guest user you can remove guest user.

6
  • 3
    This was down voted, but this is the most cleanest solution. The other two answers suggest a ton of unneeded steps. Note you have to be the guest user, to disable guest functionality. You cannot do this as a admin user.
    – MeowMeow
    Commented Mar 8, 2017 at 16:25
  • 14
    This does not remove the Guest account, it just removes the data for the last Guest login.
    – Kai Carver
    Commented Oct 12, 2017 at 1:40
  • 1
    For me it seemed to remove the option to switch to Guest.
    – nafg
    Commented Mar 5, 2018 at 17:43
  • I used adb shell settings put global guest_user_enabled 0 command from above and THEN I had switched to guest account and removed it, as described user205426 and ONLY AFTER THAT the guest account feature was disabled. Commented Nov 16, 2018 at 18:32
  • In my device, this worked. It disables guest account and removes it from notification bar. It can be enabled again right if I go to settings and switch to guest account again.
    – Sepehr GH
    Commented Jan 15, 2019 at 11:25
3

After much effort, I tried this simple method and it worked to solve the problem of being able to create a new user or logon as a guest with zero prompts for a password from the lock screen. Note that you actually have to log on using the guest account for this to work:

Log onto the guest account, and then from settings -> users -> remove guest user. After a reboot, the option to create a new user or logon as a guest is no longer available from the lock screen.

0
2

There is a now a better solution available named Single User Mod (tested on stock Android 7.1.1 but should work for earlier Android versions too).

Pre-requisites: Magisk (framework) and Magisk Manager (app) installed.

Open Magisk Manager app → go to Downloads → search for Single User Modinstall it → reboot the device.

That's it.

(Click an image to enlarge it)

IMG: IMG:

As you can see, that blue icon for user account at the top is no more visible. The Settings app also hides the Users settings option.

How does the mod works?

There is a fantastic binary made available on-the-fly by Magisk framework named resetprop (under /sbin) which does the magic. It is instructed to change fw.show_multiuserui and fw.max_users in memory before SystemUI app is loaded.

2

Without rooting the device and still be able to change build.prop, no need for adb or developer tools.

In short: I found the right twrp for my device, then used latest Odin to flash twrp on it. Then from twrp advanced file manager copied build.prop from system to an SD card, restart, modify the copied build.prop, restart into twrp, rename original file (basically make a backup), and copy back the modified file into system. then select it and use the chmod 755 button (or go into the terminal and run chmod 744 build.prop. Note that only root can have write permissions or your device won't boot).

Specific: (tested on a Samsung Tab A T550 9.7" with Android Marshmallow 6.0.1)

  1. Google and download the latest Odin, unzip it.

  2. Google twrp and your device, download it. I don't know if the latest version of twrp works for every device, but at worst it won't but it won't harm your device.

  3. Search how to restart your device in download mode. Mine was pressing power+home+downvol for approximately 4 sec. (while the device is powered off, obviously).

  4. When the download screen appears, connect to the PC and open Odin. The device detected under com should be blue.

  5. Press the ap button and browse to select the twrp file you downloaded.

  6. Verify that re-partition is not checked under the Options tab.

  7. Press start.

  8. The device reboots normally, you need to power it off and start in twrp mode. In my case it was done by pressing power+home+upvol for approximately 4 sec.

  9. In twrp, don't start in read mode (the first time it asks). You won't root, but you will change a system file.

  10. In my case while using twrp, the touch detection was a bit off to the left and I needed to press harder, so beware the annoying and damaging fat fingers.

  11. Press the mount button, select system so it's checked, and uncheck read mode if it's selected.

  12. Go back (press Home) and press the Advanced button, then File Manager.

  13. Go to System, then select build.prop file.

  14. Press copy file, select a destination folder where any user can read it. I used an SD card (you can use the terminal to chmod the file copied, but it is faster from Windows).

  15. Go back and press Reboot, then System. It will reboot normally.

  16. Connect the device to the PC and open the copied build.prop (Notepad won't work. Use Notepad++) and edit what you want. In my case I only added fw.max_users=1 below the last line. Save it.

  17. if you couldn't open it because of permissions, first copy the file into the desktop and then modify that file then copy it back and replace it.

  18. Disconnect the device and restart into twrp.

  19. Again go to mount and check system, then go to Advanced and then use the file manager to go to system and select build.prop.

  20. Rename it (add .bak at the end or whatever) so it's backed up.

  21. Browse to the modified build.prop, and copy or move it to the system directory.

  22. Browse to the system directory and select the newly copied build.prop, then press the chmod 755 button and confirm, as I said, even if you don't modify the original file. Just changing permissions to grant write access to anyone besides root will make your device hang on boot. If that happens, restart by pressing power + downvol for some time. Then immediately after it powers off press either power+home+upvol (twrp to change back whatever you did) or power+home+downvol (download mode, if all fails you can still flash the official image from Odin, you just have to Google your device and the Android version then official image, make sure it's the right one).

  23. Restart and it's done, no more guest or add user, and no rooting, although from download you can flash a root image (if there is one for your device) or from twrp you can install Supersu to become root. You can say this method is as difficult as rooting, but I prefer to avoid rooting. twrp will be there, but it won't get in the way of anything.

0

The script solution worked for me:

adb shell settings put global guest_user_enabled 0

Make sure developer mode is enabled on the Droid: Settings -> About Device and then tap the Build number 7 times (and hop on one foot while rubbing tummy !!)

HOWEVER worked for me ONLY after I installed the Samsung developer USB driver for Windows available here: https://developer.samsung.com/galaxy/others/android-usb-driver-for-windows

Then the USB dialog box come up on the Droid. Then the script works.

Use this script as a test of the whole "system" adb devices It should find a device and output a MAC address or something. When you have that working then go for the script at the top.

You do not need to download the whole SDK environment. You can get the guts of ADB here: https://forum.xda-developers.com/showthread.php?t=2317790

Then simply unzip it into a directory (Get Winzip or similar). Run CMD (the DOS command window) and use the CD command to get into that directory where the adb.exe is (from the zip file). Then test with adb devices. Then go for it.

Dana Keen

1
  • I did a second Samsung tablet with the above procedure and it did not immediately work. Rebooted and still no work. But then switched to guest. Then in the swipe down from top notifications I deleted the guest account (puts you back to owner user). Then ran the script again and wala! : The guest option was gone from the lock screen. Curious on this tablet the script results in no user icon at all on the lock screen (like a phone) but the other tablet (newer) still had the user icon on the lock screen but when tapped did not present the guest option. Both worked but just in different ways.
    – user281599
    Commented Dec 11, 2018 at 20:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .