|
|
#1 |
|
Major Leaguer
Join Date: Mar 2006
Posts: 280
|
Spoof MAC-address/Root User?
I'm trying to change MAC-address, but it fails. I think it requires Root User? SpoofMAC application uses Root user, even i didnt enable it in NetInfo Manager. Why this cant change it:
do shell script "sudo ifconfig en1 ether <MAC address>" I dont want to enable Root User in NetInfo Manager just because this. Last edited by hisara; 10-09-2006 at 08:13 AM. |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Jun 2003
Location: Boulder, CO USA
Posts: 19,854
|
You should not need to enable the root user. Sudo gives you temporary root privileges.
1. Can you tell us why you want to change your MAC address? Perhaps there is a better way to do what you are trying to do. What is your higher level goal? 2. You are using en1, the second interface on your computer. Is that the interface you are trying to change? On many Macs, en1 is the Airport interface, although on my PowerMac G5 dual-core, it is the second wired ethernet interface. Are you really trying to change en1 or do you actually want to use en0 there? 3. What form are you entering the MAC address in? It should be "a series of colon-separated hex digits." 4. Why don't you, for troubleshooting purposes, go directly to the command line, bypassing Applescript? Just open up your Terminal, and enter the sudo ifconfig en1 ether MA:CA:dd:re:ss:00 What response do you get? What do you then get from ifconfig en1 | grep ether 5. Exactly how do you know it fails? Are you checking with another ifconfig command? Or checking from an external device? Which one? What is your methodology? 6. Is the interface up when you try to change it's MAC Address? It needs to be up. sudo ifconfig en1 up Trevor Last edited by trevor; 10-09-2006 at 01:46 PM. |
|
|
|
|
|
#3 |
|
Major Leaguer
Join Date: Mar 2006
Posts: 280
|
I'm trying to change MAC-address for Airport, which is en1.
It complained that "not in the sudoers file. This incident will be reported." so i enabled "Allow user to administer this computer" first. I dont want to keep that preference turned on all the time, so is there a way to change MAC-address using Standard-account? If i use Terminal: Home:~ myname$ sudo ifconfig en1 up Password: Home:~ myname$ sudo ifconfig en1 ether 11:22:33:44:55:66 Home:~ myname$ ifconfig en1 | grep ether ether ol:dm:ac:ad:dr:es Home:~ myname$ If i try AppleScript: do shell script "sudo ifconfig en1 up" do shell script "sudo ifconfig en1 ether 11:22:33:44:55:66" do shell script "ifconfig en1 | grep ether" Event Log: tell current application do shell script "sudo ifconfig en1 up" "" do shell script "sudo ifconfig en1 ether 11:22:33:44:55:66" "" do shell script "ifconfig en1 | grep ether" " ether ol:dm:ac:ad:dr:es " end tell >Exactly how do you know it fails? Are you checking with another ifconfig command? >Or checking from an external device? Which one? What is your methodology? Home:~ myname$ ifconfig en1 | grep ether ether ol:dm:ac:ad:dr:es BTW, how long sudo gives temporary root priviledges? Is there easy way to make it shorter? Thanks |
|
|
|
|
|
#4 |
|
Site Admin
Join Date: Jan 2002
Location: Montreal
Posts: 32,473
|
You forgot to answer Trevor's first question (#1) - which was the most important one.
To change anything related to the system as a whole will require administrator access. The timeout for 'sudo' access is 5 minutes. This is configured in the file /etc/sudoers But you can use 'sudo -k' to "kill" the timeout immediately. Read 'man sudo'
__________________
hayne.net/macosx.html |
|
|
|
|
|
#5 | ||||||||||||||||||||||||||||||||||||||
|
Moderator
Join Date: Jun 2003
Location: Boulder, CO USA
Posts: 19,854
|
As Hayne mentioned, please answer my question #1. It is very likely that we can help you better with this information from you.
This is exactly why it is best to troubleshoot these commands directly from the command line, instead of using Applescript. You did not see this error message in Applescript, so you could have continued doing this until you were blue in the face and got nowhere. From the command line, you saw an error message and were able to correct the problem by enabling your user as an Admin. By default, sudo gives temporary root privileges to Admin users. To change the MAC address, which is a very important change to your entire computer, you must have root privileges, which by default you can only get from an Admin account. If you read man sudo, you will see that sudo can actually be highly customized using the /etc/sudoers file, and these defaults can be changed. But be very very aware of any security implications of any changes you make to this file--you don't want to lock and bar the front door to your computer but leave the back door wide open with a flashing neon sign saying "Expensive Stuff Here" on it.
Hmmm. Odd. I don't have an Airport installed in the computer I'm typing at now, but this works fine for me on the wired ethernet interfaces that I can directly test. I'll post again after I've tested this with an Airport card. Trevor |
||||||||||||||||||||||||||||||||||||||
|
|
|
|
|
#6 |
|
MVP
Join Date: Apr 2004
Location: Cumbria, UK
Posts: 2,461
|
The utility at '/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources' called 'airport' has an option that allows the MAC address of the card to be changed - which might be tried if the ifconfig approach doesn't work.
|
|
|
|
|
|
#7 |
|
Registered User
Join Date: Oct 2006
Posts: 1
|
Sorry to inform you that the following command:
Code:
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport --mac=AU:TR:EA:DR:ES:SE |
|
|
|
|
|
#8 | |||||||||||||||||||||||
|
MVP
Join Date: Apr 2004
Location: Cumbria, UK
Posts: 2,461
|
If the MAC address shown is the one you are trying to change to then I'm not surprised - the MAC address used needs to be in valid EUI-48 format. Last edited by bramley; 10-18-2006 at 08:17 AM. |
|||||||||||||||||||||||
|
|
|
![]() |
|
|