![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| OS X (Apple) OS X is a line of Unix-based graphical operating systems developed, marketed, and sold by Apple. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Change IP Adress | magasem | HP-UX | 1 | 08-26-2006 07:13 PM |
| How to change the MAC adress in ethernet adapter for SUN | mono673 | UNIX for Dummies Questions & Answers | 1 | 02-08-2006 09:46 AM |
| Capture IP Adress | pascalbout | AIX | 14 | 01-30-2006 07:51 AM |
| IP-Adress | MuellerUrs | SUN Solaris | 1 | 09-30-2005 08:15 AM |
| MAC-Adress | nkochr | UNIX for Dummies Questions & Answers | 2 | 09-26-2001 08:16 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
Obtain Mac Adress in crontab
hello,
I need to obtain the Mac Adress and write him in a file. I'm trying to do this with a command in crontab, with ifconfig, but it's only possible do this if i disabled the password for run the command, but than i have security problems. I'm searching for a script (.sh) that allows me to do that, in crontab, without those problems. Is it possible? Thus anyone have a sript to do this? Thanks, Pedro |
| Forum Sponsor | ||
|
|
|
|||
|
Quote:
|
|
|||
|
Quote:
I'm not an expertise in MAC OSX. Can you help me? Can you show me the command line that i can use in the crontab? At this momment I have the sudoers file configured to not ask for password, but i want to put him asking for the password. The objective is to put Mac Adress in a file txt during the reboot process, without human intervention. Thanks for your help. Pedro Almeida |
|
|||
|
I have found this:
NOPASSWD and PASSWD By default, sudo requires that a user authenticate him or herself before running a command. This behavior can be modified via the NOPASSWD tag. Like a Runas_Spec, the NOPASSWD tag sets a default for the commands that follow it in the Cmnd_Spec_List. Conversely, the PASSWD tag can be used to reverse things. For example: ray rushmore = NOPASSWD: /bin/kill, /bin/ls, /usr/bin/lprmwould allow the user ray to run /bin/kill, /bin/ls, and /usr/bin/lprm as root on the machine rushmore as root without authenticating himself. If we only want ray to be able to run /bin/kill without a password the entry would be: ray rushmore = NOPASSWD: /bin/kill, PASSWD: /bin/ls, /usr/bin/lprmNote, however, that the PASSWD tag has no effect on users who are in the group specified by the exempt_group option. By default, if the NOPASSWD tag is applied to any of the entries for a user on the current host, he or she will be able to run sudo -l without a password. Additionally, a user may only run sudo -v without a password if the NOPASSWD tag is present for all a user's entries that pertain to the current host. This behavior may be overridden via the verifypw and listpw options. My question is: Can I exclude just one command from the need of Password for all users? I'm using something like this ifconfig en1 | grep ether >> /something/MacAdress.txt Thanks PA |
|
|||
|
Why don't you just run that command as root during the boot process? I'm not particularly familiar with Mac OS X either, so how exactly to do that is not my table, but in general, just add a small init script in your local equivalent of /etc/init.d/rc.local or similar.
Do you really expect your MAC address to change between reboots ...? |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|