Changing the Short Name

So I had an interesting problem this week.

The newer versions of FileMaker Pro pick up the users short name when logging such things as who changed a record. This means that when a staff member leaves and their computer is taken over by the replacement you need to change the short name but leave everything else in place.

Since OS X doesn’t allow you to just change the short name we have a bit of a problem.

Once again the BSD roots of OS X come to the aid of the party.

With the user ‘Peter Piper’ (short name ‘piper’) and our DTS account the only users I logged out ‘Peter Piper’ and logged in ‘dts’. Still in the GUI I created the user ‘Jack Spratt’ (short name ‘jack’) and then fired up Terminal.

I started with :

%sudo -s

which got me in as root. I proceeded with :

#chown -R spratt:spratt /Users/piper

which changed the old users entire home folder so it was owned by the new user.

#rm -rf /Users/jack

#mv /Users/piper /Users/jack

then moves the old users folder into place under the new user and we are done.

Now we have all the old users files and set up but a new short and long name. Gotta love Unix.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s