How to change login picture for 'Other'

Morningside
Contributor II

In Mac OS, when you have your login screen configured to show a list of users (as opposed to a username/password text box combo), each user is accompanied by a large circular image. This is alternately known as a 'User Picture' or a 'Login Picture'. All users have such an image even if they are the generic gray silhouette image.

Furthermore, when you enable network users to log into your mac, and have the login screen configured to show a list of users, the User Pic that accompanies the 'Other...' user is a special login picture, which is a gray silhouette of three individuals. Like this:

ab27a8fbef0c4fd8bef45acc59fc5a51

I would like to change this image so that I can have a more fun picture for the students in my school to click on when they want to login with their network account. I do not know how to do this.

One idea I have, and it is really more of a brute force idea, is to find that image on the hard drive and replace it with a picture of my choice. I am open to other ideas, however.

Does anyone know how to accomplish this?

I already have a script to grab a random login picture and assign it to Admin and a different random pic for the generic Student account.

2 ACCEPTED SOLUTIONS

Morningside
Contributor II

Hi @sshort thanks for the comment. The link you offered is familiar to me. The script I am using successfully replaces the login picture for admin and the generic student account already, so I am familiar with the process in general. The distinction between Mobile accounts and Network accounts is a little bit of a red herring, but the students who would be clicking on 'Other...' to login would be using pure network accounts hosted on Apple Open Directory. Regardless, it is the image associated with the 'Other...' prompt that I want to change, not the image for individuals who have logged in already and might appear on the login screen in a fast-user-switching scenario. make sense? In the interest of maximum transparency, here is the script I am using, and I will add the Other image I am referring to as well (to the original post, if possible).

#!/bin/bash

##
## sets the user pictures randomly
##

# Create the array of pictures

pic_array[0]="/Library/User Pictures/StarWars/0.png"
pic_array[1]="/Library/User Pictures/StarWars/1.png"
pic_array[2]="/Library/User Pictures/StarWars/2.png"
pic_array[3]="/Library/User Pictures/StarWars/3.png"
pic_array[4]="/Library/User Pictures/StarWars/4.png"
pic_array[5]="/Library/User Pictures/StarWars/5.png"
pic_array[6]="/Library/User Pictures/StarWars/6.png"
pic_array[7]="/Library/User Pictures/StarWars/7.png"
pic_array[8]="/Library/User Pictures/StarWars/8.png"
pic_array[9]="/Library/User Pictures/StarWars/9.png"
pic_array[10]="/Library/User Pictures/StarWars/10.png"
pic_array[11]="/Library/User Pictures/StarWars/11.png"
pic_array[12]="/Library/User Pictures/StarWars/12.png"
pic_array[13]="/Library/User Pictures/StarWars/13.png"
pic_array[14]="/Library/User Pictures/StarWars/14.png"
pic_array[15]="/Library/User Pictures/StarWars/15.png"
pic_array[16]="/Library/User Pictures/StarWars/16.png"
pic_array[17]="/Library/User Pictures/StarWars/17.png"
pic_array[18]="/Library/User Pictures/StarWars/18.png"
pic_array[19]="/Library/User Pictures/StarWars/19.png"
pic_array[20]="/Library/User Pictures/StarWars/20.png"

# Randomize Student Picture
num=$[RANDOM % 21]
echo $num
student_pic=${pic_array[$num]}
echo $student_pic

`dscl . delete /Users/student JPEGPhoto`
`dscl . create /Users/student Picture "$student_pic"`

# Randomize Admin Picture
while :
do
    num2=$[RANDOM % 21]
    echo $num2 $num
    if [ $num2 != $num ]
    then
        break
    fi
done
admin_pic=${pic_array[$num2]}
echo $admin_pic

`dscl . delete /Users/admin JPEGPhoto`
`dscl . create /Users/admin Picture "$admin_pic"`

# Randomize 'Other' picture
while :
do
    num3=$[RANDOM % 21]
    echo $num $num2 $num3
    if [ $num3 != $num ] && [ $num3 != $num2 ]
    then
        break
    fi
done
other_pic=${pic_array[$num3]}
echo $other_pic

ev_location="/System/Library/PrivateFrameworks/LoginUIKit.framework/Versions/Current/Frameworks/LoginUICore.framework/Resources/OtherUser.png"
`cp "$other_pic" "$ev_location"`

View solution in original post

Morningside
Contributor II

The location of the file that needs overwritten for the Other User is here:

/System/Library/PrivateFrameworks/LoginUIKit.framework/Versions/Current/Frameworks/LoginUICore.framework/Resources/OtherUser.png

I have updated the script in the link above to reflect it.

View solution in original post

5 REPLIES 5

triding
New Contributor III

Use the following information at your own risk! Seriously. The following information is for reference only, I strongly suggest you don't mess with the files. Having written that disclaimer, here's the information you required...

The location of that 'Other' picture file.... its not a jpg, it's actually an .icns file. So whatever picture you decided to replace it with would have to be created as an icns bundle. Here's the kicker... where that file lives....

System⁩ ▸ ⁨Library⁩ ▸ ⁨CoreServices⁩ ▸ ⁨CoreTypes.bundle⁩ ▸ ⁨Contents⁩ ▸ ⁨Resources⁩ ▸ ⁨Everyone.icns

So it's SIP enabled.

Bottom line.... I really wouldn't bother trying! :-)

Morningside
Contributor II

@triding Thanks for the great tip! I don't think this is the icns file used on the login screen though, and here's why: I have a script that successfully overwrites that file (verifiable in Finder by navigating to the image and viewing it), but the image doesn't change on the login screen, even after a reboot. I have disabled SIP already, BTW. Any ideas?

sshort
Valued Contributor

@Morningside Have you checked out this post? https://scriptingosx.com/2018/10/changing-a-users-login-picture/

You'd probably have to set this as a policy/script that runs at logout so that future logins will show the desired user icon. Another issue to consider: are these mobile cached AD users, or pure network accounts? It's been a while, but I vaguely remember network accounts not playing well with any attempted adjustment, whereas a mobile user allowed an icon to be set.

Morningside
Contributor II

Hi @sshort thanks for the comment. The link you offered is familiar to me. The script I am using successfully replaces the login picture for admin and the generic student account already, so I am familiar with the process in general. The distinction between Mobile accounts and Network accounts is a little bit of a red herring, but the students who would be clicking on 'Other...' to login would be using pure network accounts hosted on Apple Open Directory. Regardless, it is the image associated with the 'Other...' prompt that I want to change, not the image for individuals who have logged in already and might appear on the login screen in a fast-user-switching scenario. make sense? In the interest of maximum transparency, here is the script I am using, and I will add the Other image I am referring to as well (to the original post, if possible).

#!/bin/bash

##
## sets the user pictures randomly
##

# Create the array of pictures

pic_array[0]="/Library/User Pictures/StarWars/0.png"
pic_array[1]="/Library/User Pictures/StarWars/1.png"
pic_array[2]="/Library/User Pictures/StarWars/2.png"
pic_array[3]="/Library/User Pictures/StarWars/3.png"
pic_array[4]="/Library/User Pictures/StarWars/4.png"
pic_array[5]="/Library/User Pictures/StarWars/5.png"
pic_array[6]="/Library/User Pictures/StarWars/6.png"
pic_array[7]="/Library/User Pictures/StarWars/7.png"
pic_array[8]="/Library/User Pictures/StarWars/8.png"
pic_array[9]="/Library/User Pictures/StarWars/9.png"
pic_array[10]="/Library/User Pictures/StarWars/10.png"
pic_array[11]="/Library/User Pictures/StarWars/11.png"
pic_array[12]="/Library/User Pictures/StarWars/12.png"
pic_array[13]="/Library/User Pictures/StarWars/13.png"
pic_array[14]="/Library/User Pictures/StarWars/14.png"
pic_array[15]="/Library/User Pictures/StarWars/15.png"
pic_array[16]="/Library/User Pictures/StarWars/16.png"
pic_array[17]="/Library/User Pictures/StarWars/17.png"
pic_array[18]="/Library/User Pictures/StarWars/18.png"
pic_array[19]="/Library/User Pictures/StarWars/19.png"
pic_array[20]="/Library/User Pictures/StarWars/20.png"

# Randomize Student Picture
num=$[RANDOM % 21]
echo $num
student_pic=${pic_array[$num]}
echo $student_pic

`dscl . delete /Users/student JPEGPhoto`
`dscl . create /Users/student Picture "$student_pic"`

# Randomize Admin Picture
while :
do
    num2=$[RANDOM % 21]
    echo $num2 $num
    if [ $num2 != $num ]
    then
        break
    fi
done
admin_pic=${pic_array[$num2]}
echo $admin_pic

`dscl . delete /Users/admin JPEGPhoto`
`dscl . create /Users/admin Picture "$admin_pic"`

# Randomize 'Other' picture
while :
do
    num3=$[RANDOM % 21]
    echo $num $num2 $num3
    if [ $num3 != $num ] && [ $num3 != $num2 ]
    then
        break
    fi
done
other_pic=${pic_array[$num3]}
echo $other_pic

ev_location="/System/Library/PrivateFrameworks/LoginUIKit.framework/Versions/Current/Frameworks/LoginUICore.framework/Resources/OtherUser.png"
`cp "$other_pic" "$ev_location"`

Morningside
Contributor II

The location of the file that needs overwritten for the Other User is here:

/System/Library/PrivateFrameworks/LoginUIKit.framework/Versions/Current/Frameworks/LoginUICore.framework/Resources/OtherUser.png

I have updated the script in the link above to reflect it.