Go Back   The macosxhints Forums > OS X Help Requests > UNIX - General



Reply
 
Thread Tools Rate Thread Display Modes
Old 09-07-2003, 10:54 PM   #1
nyarlathotep
Triple-A Player
 
Join Date: Jun 2003
Posts: 90
Aliasing users

How do I make two users with the same uid? This was always easy to do under Linux, are there any caveots under Mac OS X?
nyarlathotep is offline   Reply With Quote
Old 09-08-2003, 12:23 AM   #2
gatorparrots
Major Leaguer
 
Join Date: Dec 2002
Posts: 441
Code:
#!/bin/sh

##
# addalias
# This script will create aliases entries in NetInfo
# author: gatorparrots <gatorparrots@mad.scientist.com>
#
# usage: addalias [username] [alias]
# [alias] can be a local user account or an e-mail address
##

username=$1
alias=$2

if [ $# -eq 0 ]; then
  printf "usage: addalias [username] [alias]\n"
  printf "[alias] can be a local user account or an e-mail address\n" >&2
  exit 2
fi

# Need to be a sudoer to add aliases
sudo -p "Please authenticate to add alias (administrator password): " printf "" || {
	echo "Abort: could not authenticate" >&2
	exit 1
}
if [ -z "`niutil -read . /aliases/$alias 2> /dev/null `" ]; then
    sudo niutil -create . /aliases/$alias
    sudo niutil -createprop . /aliases/$alias members $username
    echo "Alias created"
else
    sudo niutil -appendprop . /aliases/$alias members $username
    echo "Alias added"
fi
echo "$alias --> $username"
niutil -read . /aliases/$alias
gatorparrots is offline   Reply With Quote
Old 09-08-2003, 10:06 PM   #3
nyarlathotep
Triple-A Player
 
Join Date: Jun 2003
Posts: 90
Email alias?

That would just be an email alias, no? I wanted a full "login alias," same uid, diffrent login names.
Jeff
nyarlathotep is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 06:16 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.