Correct Way To Edit Sudoers File

I would like to grant non admin users the ability to run:
/sbin/shutdown
On my test machine I ran the command visudo. At the bottom of the file there seems to be an example of how to allow anyone in the group "users" on localhost to run the "shutdown" command. I uncommented out this line.
%users localhost=/sbin/shutdown -h now
I then logged in as a non admin user. I ran the command
sudo -l
It told me that the current user is not allowed to run sudo. After doing a bit of web search I came up with the following command that I added to the bottom of the sudoers file:
ALL ALL = NOPASSWD: /sbin/shutdown
I then logged in as a non admin user. I ran the command
sudo -l
User XXX man run the following commands on this host:
(root) NOPASSWD: /sbin/shutdown
I just want to make sure that this is the correct way to do this. From what I found on line it would seem that any user could run shutdown on any host and that is not what I want.
One last question is, the machines are set up to NetBoot. The machine contain no internal drives. I just want to make sure that users will only be able to shut down a machine they are logged into. Thanks for all the help in advance and sorry if the question is a bit noobish.

I think I had to do something like this a while back. Let me look though my records and see if I can dig anything up.
PowerBook G4   Mac OS X (10.4)  

Similar Messages

  • Is there any easier way to edit imovie files that have been exported as mov file then added to FCE 4?? As every move I make has to be rendered and takes forever??? Also my recording is going out of focus without me touching the camera, why has this happen

    Is there any easier way to edit imovie files that have been exported as mov file then added to FCE 4?? As every move I make has to be rendered and takes forever??? Also my recording is going out of focus without me touching the camera, why has this happened any idea what causes this??
    iMovie '08, Mac OS X (10.5.8), FCE 4

    My daughter has had her Razr for about 9 months now.  About two weeks ago she picked up her phone in the morning on her way to school when she noticed two cracks, both starting at the camera lens. One goes completely to the bottom and the other goes sharply to the side. She has never dropped it and me and my husband went over it with a fine tooth comb. We looked under a magnifying glass and could no find any reason for the glass to crack. Not one ding, scratch or bang. Our daughter really takes good care of her stuff, but we still wanted to make sure before we sent it in for repairs. Well we did and we got a reply from Motorola with a picture of the cracks saying this was customer abuse and that it is not covered under warranty. Even though they did not find any physical damage to back it up. Well I e-mailed them back and told them I did a little research and found pages of people having the same problems. Well I did not hear from them until I received a notice from Fed Ex that they were sending the phone back. NOT FIXED!!! I went to look up why and guess what there is no case open any more for the phone. It has been wiped clean. I put in the RMA # it comes back not found, I put in the ID #, the SN# and all comes back not found. Yet a day earlier all the info was there. I know there is a lot more people like me and all of you, but they just don't want to be bothered so they pay to have it fix, just to have it do it again. Unless they have found the problem and only fixing it on a customer pay only set up. I am furious and will not be recommending this phone to anyone. And to think I was considering this phone for my next up grade! NOT!!!!

  • Cannot edit sudoers file in single user mode.

    I did not back up my sudoers file on my pro.
    I made a change to it, adding my "test" user to be able to use sudo, but upon restarting, it didn't work, and I cannot edit the file via cd in single user mode.
    I mounted the drive, changed permissions, but it seems that I don't have the option to use vi, visudo, vim.
    Thanks for the help.

    I mounted the hdd using the command below.
    I then made sure I could get to the file by cd to it.
    Then once I was there, i would attempt to type vis <tab> to complete, and visudo does not show up. Typed in visudo, nothing. This was on a brand new mb pro. I can wipe it out, but I would rather figure out why its not working.
    The reason for all this is I have to give it to a user at my job. We don't want them to have admin rights to install anything they want, but they need to use sudo in X11 for compiling and such. I read online that I can edit/add their username to the sudoers file, and allow them the right to sudo for compiling, starting apache on their laptops, etc.
    Thanks.

  • Effecient way to edit a file in Java

    I'm writing software for my company that is basically a primitive database (using a text file) to store entries for people that have filled out a warranty card. Right now the list is very small, less than 1000 entries, so access times don't cause very noticeable delays, but I wanted to build the program so that once the list grew, my algorithm's inefficiencies didn't cause big delays.
    Right now I have it so when a new entry is added, it simply adds it to the end of the file, so that's O(1). Searching for a file is O(n) (searches from beginning of file to the end until a match is found, which I know that can be improved with startup sorting and changing algorithms, something I am working on).
    Right now I'm trying to think of an efficient way to edit an entry in the file. Obviously first the entry has to be located to be edited, so that part will be patterned after my search algorithm. But after locating the entry, what's the best way in Java to edit that line? The best option I can think of right now is to load the whole text file into memory, make the change, and replace the original text file with the one stored on memory. But that seems like a lot of overhead just to edit one line. Is there a better algorithm I am overlooking? Thanks ahead of time.

    jrobinson3k1 wrote:
    The best option I can think of right now is to load the whole text file into memory, make the change, and replace the original text file with the one stored on memory. But that seems like a lot of overhead just to edit one line. Is there a better algorithm I am overlooking? Thanks ahead of time.That's what all text editors do. That's what you do yourself when you want to change one line of your source code. If changing the line of text can change its length (which normally it can) then you have the best algorithm. Except of course for the database. You have the best algorithm that can be implemented in the next couple of days, let's put it that way.

  • Is there a way to edit raw files from the Canon 5DMkIII in Lightroom 2?

    I rented a Canon 5DMkIII this past weekend and shot in RAW. I'm running Lightroom 2.7 on my laptop because I have a pre-Intel dual-G5 tower at home and can't run LR3 or LR4 on a pre-Intel chip machine and I tend to share my libraries across my laptop to my tower and back (so I need to be able to open the LR files on both machines, which is why I'm still using LR2 ... I know, I know, I need to upgrade but that's going to be a hefty investment!)... In the meantime, I'm wondering if there's a way to view/edit the raw files in Lightroom? They won't even import (I get the message upon import attempt: "Some import operations were not performed. (97)")... I know the information is there, though, because I used PhotoMechanic to do the initial sort of my images that I wanted to keep/edit. I see there's ACR (Adobe Camera Raw) 6.7 (I think it is) that supports the 5DMkIII, but I'd prefer to edit across the board in Lightroom, it's so much faster. Is there something I can download to still edit my raw files in LR2? Or, do I have to buy the update and get LR4 if I want to edit my 5DMkIII RAW files? Thanks in advance for your help!!

    Support for the canon 5d Mk111 was introduced in LR 4, ACR 6.7 so you will have to use the Adobe DNG Converter 6.7 or later to convert the raw files to dng format before you can import and work with the files in LR 2. The converter is a free download from Adobe and is available at this link.
    Mac http://www.adobe.com/support/downloads/detail.jsp?ftpID=5485
    Win http://www.adobe.com/support/downloads/detail.jsp?ftpID=5486

  • I need to know best way to edit MXF files, with least rendering, is that converting the MXF or Log and Transfer? the end product is dvd, but I have lots and lots of these projects to do.

    I am about to comence my Edit, and was told of Mpeg Streamclip, however this doesn't seem to work with my Canon XF305 Clips, the reason I was told to use it was so I wouldn't have to Render in Final Cut Pro all the time.. I do have the Canon Disc with the Plug in Utility and the update from their site.
    Is it best to Convert these MXF files first and import them into FCP or use 'Log and Transfer', so far I am unable to do either!!
    The projects on the timeline will have introduction .Movs already on it as a Template to re-use again and again with the new Footage ( MXF Files ) to be added and edited with transitions etc..This process is repeated again and again but with different MXF clips each time.
      I am looking for the quickest and best way for workflow as there are 80 or more projects to do, each with 10 or so clips to be added to the timeline and Exported for DVD...Will I have to then Compress to fit onto DVD's??
    I know Streamclip is an Mepeg 2 app but I thought the Canon XF305 Shot as mpeg2....
    Is Log and Transfer my only Option?
    Basically I need to know the quickest for Render purposes, and of course, the best way so the files aren't so huge etc etc.
    Please, any suggestions would be greatly received....

    We only work with PR422 files in FC7.  We use Shane's workflow with all 5D & MXF footage.
    Make your life easier and stick to the ProRes family for your footage and edit sequences. Avoid H264 & convert any you have to ProRes.
    Unless you are considering Blu-Ray the only way to deliver video on a DVD is to convert it to SD.
    Depending on the length of your show you can make a Blu-Ray in Compressor but you have very limited authoring options when compared to DVD Studio Pro.
    Compressor can also convert your HD to SD mpg-2 & Ac3 files. The best results usually come from setting the frame controls in the mpg-2 setting of Compressor to best. Depending on the the length of the show and your Qmaster settings this can take quite a while.
    I personally find Compressor's HD to SD DVD conversion varies. Sometimes it is wonderful and sometimes not so much. I prefer the following as it is usually is faster and very consistent.
    Export a quicktime movie (not QT conversion) of your final sequence
    Import the exported HD file back into FC.
    Create a SD 16x9 sequence and then drop in the recently exported HD seq and render. Rendering the sequence basically has FC doing the HD to SD conversion. Export the SD sequence and then convert to mpg-2 & ac3 in Compressor. While this does take time I still find it faster than Compressor with Qmaster utilizing all cores.
    Another option is using jobs in Compressor
    http://pixelcorps.cachefly.net/macbreak-154-540p-h264.mov
    In this workflow you would have Compressor convert the HD file to SD and then through jobs convert the SD file to mpg2 & Ac3. 
    In theory the jobs version could be faster (based on a number of variables- length, Qmaster, etc) but I haven't had time to compare the two. 

  • The 'Correct way' to move source files

    So chalk me up as another person having issues with relinking files that have been moved in the finder.  I don't understand how this can be such an issue but FCPX just won't relink them.
    Anyway amongst all the threads of others having this issue there is no clear remedy if you have already done it but several people have commented ' you should have used FCPX to move the files.  '
    How do you do this ?  Since thered is no file tree in FCPX how on earth do you use it to move the files ?  The only structural tree there is is for the events and the way I have been working, my events are all saved on one drive but they don't contain the source files, only references to them.  So dargging and dropping the events onto another drive wouldn't be the solution.
    Any help much appreciated.....

    OK, so then I don't know what you're trying to do.
    When I import, I do not have the check box set to move the files to the project folder.  Therefore the files reside on an external drive and in the 'originals' folder, FCPX just puts a reference (an alias ).
    What I want to do, is move the location of those files on the external drive, call it drive A, which is now full, to drve B, a new drive. 
    That's the bit that seems like a really common necessity to me.
    But doing this obviously breaks the references and trying to re-link them it tells me the framerates are wrong.  Which is incorrect, because how could simply dragging a file from one drive to another change the framerate ?
    That can happen. It depednds on how you moved the files and where you moved thme to. If you moved the refrerneced files at the finder level and are trying to relink them you try to do this at the finder level.
    Yes I moved them at the finder level, what other ways are there to do it ?  That's the exact question I'm asking, is there another way I should have done it.
    How do you re-link at finder level ? Is that what you are suggesting ?
    That's correct. That's common in most database driven applications.
    That would be fine, but then why offer you the option to leave the files in their original location when importing ?  That's where this all starts to go south because that's the one loophole to get out of their organizational methods.  If they had forced me from the beginning to conform to their method entirely then I wouldn't be in this mess.  It seems like they haven't condisered the ramifications of that option.

  • Correct way to compress 16X9 file for the web

    Hello: Shot an HDV project. After importing converted files to DVCProHD. 1280X1080 16X9. Edited 5 min. piece. Exported QT with current settings. Need to upload to You Tube. Please tell me...what's the best choice in Compressor? I tried H.264 Streaming 800kbps and the file now looks 4X3. Please help. THANKS!

    sdl wrote:
    I tried H.264 Streaming 800kbps and the file now looks 4X3.
    Because of the non-square pixel format you're mastering in (DVCProHD) you have to force the frame size to 1280x720. And for an HD file, you can up the bit rate to about 2000 kbps for YouTube. (I believe 800 kbps is recommended for the 16:9 High Quality file)
    Also, be sure to turn on Frame Controls (in Compressor), as it'll help maintain sharpness that will otherwise be lost when going to 1280x720. Though that'll up the encode time significantly...

  • Correct way to parse the file with named captures

    Hello!
    I'm trying to build the configuration parser script, as I'm new on powershel /regex I have a lot of questions.
    I have the following source file:
    add chain=input comment=Accept dst-port=53 protocol=udp src-address-list=DNS_servers
    add chain=input comment=AcceptDNSqueries dst-port=53 protocol=udp src-address-list=Servers
    add chain=input comment=AcceptDNS dst-port=53 protocol=tcp src-address-list=DNS_servers
    add chain=input comment=DHCP_relay dst-address-list=DHCP dst-port=67,68 protocol=udp src-address-list=IntIp
    The following result should be done (results as csv format, the captures with no value are divided by seperator):
    Chain,Comment,dst-port,protocol,src-address-list,dst-address-list
    input,Accept,53,udp,DNS_servers,,
    input,AcceptDNSqueries,53,udp,,Servers
    input,Acceptudp,,udp,,Servers
    According the following
    link we can use the named captures. I have played with it and noticed that this script works only when data is at predefined order (or by using a lot of or expressions by repeating them when needed).
    Question: how to parse the file when it's possible to use various captures with data located on different order(some values at configuration file is missing)? Is it possible to modify the script on link or we need to work with different approach?
    Thanks!

    Try this:
    $text =
    add chain=input comment=Accept dst-port=53 protocol=udp src-address-list=DNS_servers
    add chain=input comment=AcceptDNSqueries dst-port=53 protocol=udp src-address-list=Servers
    add chain=input comment=AcceptDNS dst-port=53 protocol=tcp src-address-list=DNS_servers
    add chain=input comment=DHCP_relay dst-address-list=DHCP dst-port=67,68 protocol=udp src-address-list=IntI
    '@ | set-content sourcefile.txt
    get-content sourcefile.txt |
    foreach {
    new-object PSObject -Property $($_ -replace '^add ' -replace ' ',"`n" | convertfrom-stringdata) |
    select Chain,Comment,dst-port,protocol,src-address-list,dst-address-list
    } | ft -auto
    chain comment          dst-port protocol src-address-list dst-address-list
    input Accept           53       udp      DNS_servers                      
    input AcceptDNSqueries 53       udp      Servers                          
    input AcceptDNS        53       tcp      DNS_servers                      
    input DHCP_relay       67,68    udp      IntI             DHCP            
    I know, it's not "named captures", but those key=value pairs just beg to be run through convertfrom-stringdata.
    Edit: just noticed I missed the dst-address-list.  Fixed.
    [string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " "

  • Best way to edit PHP files in FB4?

    I'm trying out FB4 and would like to be able to use a PHP editor within the FB application. At the moment the PHP files it generates open up in Dreamweaver, which is fine but it would be better to have one tool than two. I tried to install the Eclipse PDT but I don't see any more options after I've installed it. I really would like nice coloured formatting and maybe code assist, like DW provides. Has anyone done the same? (Also interested in the same thing for FB3).
    Thanks

    I found the PHPEclipse plugin, which installed into FB4 - will try it with FB3 now

  • What is the correct way to format file paths and names in the structapp file?

    I am trying to create a structured application to export fm files as xml, and probably read the xml back to fm.
    In the structured application file (structapp), I need to specify the locations of the various files (DTD, read/write, template, etc). I would like to place these files on a shared server so others can use the same structapp file (that is, a cop of it). What is the correct way to format the file paths and names? Can folders folder names and file names have spaces in them? I tried the following, for example:
    \\serverName\shareName\folder 1\folder 2\file name.dtd
    I use the same format for the template file and the read/write rules file.
    When I try to save an fm file to xml, FrameMaker says that it cannot read the DTD; however, the resulting xml file appears to be well-formed. The DOCTYPE element in the resulting xml is formatted with forward slashes and spaces replaced with %20.
    I tried using forward slashes and replacing spaces with %20, but then I get an error about reading the read/write rules.
    NOTE: I have another structured application to read xml into fm. This application does not have a DTD file. The template and read/write rules files are specified as above. Except for complaining about a lack of a DTD, the application works fine; it even applies an XSLT in the process. Again, when I DO add a DTD to this latter application, I get the same complaint about not being able to read the DTD.
    I am using fully patched FrameMaker 9 in Windows XP.
    Thanks,
    Van

    Hi Van,
    The XML parser and FrameMaker are not the same thing. The Error Log says which component created which message. The XSL processor is another option that can throw messages. The "\\server\path\some.dtd" syntax in structapps.fm seems to be fine for some tools, as Internet Explorer with XML tools successfully finds the DTD which appears as "//server/path/some.dtd" in the XML. But apparently Xerxes, the XML parser bundled with FrameMaker, does not like this notation.
    If you have a path with a drive letter, "H:\path\some.dtd", FrameMaker turns that into "file:///H:/path/some.dtd". It seems, Xerces would like to see "file:/" in front of absolute paths.
    This is what I have in structapps.fm:
    Template: \\server\path\projecttemplate.fm
    DTD: some.dtd
    Read/write rules: \\server\path\projectrules.txt
    DOCTYPE: …
    Entity locations
      Entity search paths
        1: \\server\path\
    In the structapps.fm I have the DTD without path information. The resulting XML (without XSL postprocessing) then contains just the file name with a relative path back to the book folder (when saving a book as XML). It therefore requires the DTD to be available at this place. I handle this using an event script that fires for NotePreSaveXml and copies the DTD to the folder of the original document.
    As I always use XSL postprocessing and using XSLT1 it is not possible to have the doctype-system as a parameter I have this in my XSL stylesheet:
    <xsl:output doctype-system="some.dtd" />
    For the resulting XML the DTD is expected to be in the same folder as the XML file. This is handled by the same event script as above, it therefore copies the DTD to the source and the target folder.
    Bottom line: If you want/have to use UNC paths, you have to do some programming to work around a FrameMaker bug.
    - Michael

  • HT4813 How to I edit this file, it says its locked and I dont have permissions: default_default.conf.default.

    I need to add index.cfm to my default document tree.  I finally found where to change it in Lion Server.  When I try to edit the file, it wont let me.  Any way to edit the file?
    default_default.conf.default.

    Sorry, are you sure that you have typed the correct password for the admin (after sudo -s)?
    hostname:sites_disabled pyro$ sudo -s
    Password:
    bash-3.2# pwd
    /private/etc/apache2/sites_disabled
    bash-3.2# ls -lha
    total 0
    drwxr-xr-x   5 root  wheel   170B Jan  3 14:56 .
    drwxr-xr-x  34 root  wheel   1.1K May  2 11:57 ..
    -rw-r--r--   1 root  wheel   697B Jan  3 10:36 0000_default_default.conf
    -rw-r--r--   1 root  wheel   697B Jan  3 10:36 default_default.conf
    -r--r--r--   1 root  wheel   697B Jan  3 10:36 default_default.conf.default
    bash-3.2# chmod 644 default_default.conf.default
    bash-3.2# ls -lha
    total 0
    drwxr-xr-x   5 root  wheel   170B Jan  3 14:56 .
    drwxr-xr-x  34 root  wheel   1.1K May  2 11:57 ..
    -rw-r--r--   1 root  wheel   697B Jan  3 10:36 0000_default_default.conf
    -rw-r--r--   1 root  wheel   697B Jan  3 10:36 default_default.conf
    -rw-r--r--   1 root  wheel   697B Jan  3 10:36 default_default.conf.default
    bash-3.2# chmod 444 default_default.conf.default
    bash-3.2# ls -lha
    total 0
    drwxr-xr-x   5 root  wheel   170B Jan  3 14:56 .
    drwxr-xr-x  34 root  wheel   1.1K May  2 11:57 ..
    -rw-r--r--   1 root  wheel   697B Jan  3 10:36 0000_default_default.conf
    -rw-r--r--   1 root  wheel   697B Jan  3 10:36 default_default.conf
    -r--r--r--   1 root  wheel   697B Jan  3 10:36 default_default.conf.default

  • Editing pages files in Linux

    I have a bit of a problem.
    I have several files as .pages documents and I need to edit these in Linux.
    (Kubuntu 9.10, fully updated)
    now I can save the .pages files as .odt and open them in OpenOffice.Org
    but, I have some markup that open document text files don't support.
    but that is kinda importaint markup.
    is there a way to edit the files on Linux, or a other file type I can use that I can open in linux without losing markup?

    now I can save the .pages files as .odt
    How? Only .doc and .rtf and .pdf and .txt are available for me.
    is there a way to edit the files on Linux
    Not .pages
    other file type I can use that I can open in linux without losing markup?
    I think .doc and .rtf and .pdf are your only choices.

  • How to edit caf files?

    Does anyone know of a way to edit caf files? I got some caf files from the web and I want to change it to make the volume louder. Are caf files like mp3 files where I can just run it through some encoder and change it's properties (like volume etc)

    Hi I had downloaded free trial & I want one pdf to convert it to excel but it is showing paid subscription.
    how to convert free ?

  • Edit history file

    Is there a way to edit history files? I know I can delete them but how can I delete a few from a days history?

    Hi BB,
    I am most likely using an earlier version of Safari than you but I'm sure it is the same for Safari 3. Look for the "book" icon in the "Bookmarks bar" and click that (should be on the left side of the bookmarks bar). A new window will open with a "History" selection in the left column (Collections). Select History and then you will be able to selectively delete history pages from the list in the right pane.
    littleshoulders

Maybe you are looking for