Replacing Hosts file without prompt

I need to provide some users a means to copy a new Hosts file into place without needing the local admin password.
What commands can I use, with admin password embedded, to allow for this?
cp and mv don't seem to allow for specifying the admin credentials.
thanks,
darrin

Try using the visudo command to edit the sudoers file so that the exact command needed to replace the hosts file doesn't require an administrator password to be invoked with sudo.
(22175)

Similar Messages

  • HT201442 error 3194 appears still even after replacing host file...need a solution....

    error 3194 appears still even after replacing host file...need a solution....

    Have you also checked your security software to ensure required ports are not being blocked?
    http://support.apple.com/kb/TS3694#communication

  • How to auto-store files without prompting 'save as'. Adobe X/Adobe X Pro

    We have a database program that we have a lot of dokuments on. We have a option to print all documents on each case, and we want to "print" all these documents (word 2003) to the PDF printer and store the files on a pre-defined adress (Example: C:\Users\UserName\Documents\StoreHere\)
    We have the "Printer" set as PDF printer as standard, so every time we press print we are prompted to where we want to print the said .doc file. So how to we avoid the prompting and make a setting a standard?
    This is OK when its 1-5 files, but when we have 1000 .doc files, things gets very tiresome.
    TL;DR: Print .doc files to PDF reader which will auto store any and all .doc files as .pdf files into a pre-defined adress without prompting "save as".

    You posted in the wrong place. This is the Reader forum and the Adobe PDF printer is a part of Acrobat...
    But anyway, to do that right-click the printer and select Printing Preferences, then go to the "Adobe PDF Settings" tab and click on the Browse button next to the "Adobe PDF Output Folder" drop-down. Select the folder where you want the files to be saved and click OK.
    That should do it...

  • Writing to a cell in an existing Excel file without prompt of overwritin​g

    I am trying to learn communicating with Excel spreadsheet via ActiveX. I started with the Labview example "Write Table to XL", however, this example creates new file which is not my case of overwriting an existing Excel spreadsheet. So, I made my changes to the VI to overwrite an existing file with my new value. Unfortunately, there is always prompt of overwriting the file, and even though I press "yes", the file keeps unchanged.
    The help I need is to kindly :
    1- check my attached VI for any mistakes
    2- make the VI overwriting the file without any prompts
    Thanks in advance
    Solved!
    Go to Solution.
    Attachments:
    Write_Value_to_Cell_ActiveX.vi ‏17 KB

    I really appreciate your help, but I already changed the configuration to open a file path taking another ActiveX example as a reference. Here is my subVI's I used, but they are merged in LLB. I am sorry for my ignorance of how to extract all the subVI's from this file.
    Attachments:
    ExcelExamples.llb ‏62 KB

  • It is possible replace .rpd file without shutdown BI server?

    I have BI server with a few repositories. I need to replace one of them with a backup file. But I don't want to shutdown BI server because the other repository is in production use. Is there way how to do it?

    The server's got a lock on the file while it's up and running. So the only possibility you have is to open the rpd in online mode and adjust your rpd manually to match your backup.
    C.

  • Mac renaming .vcs files to .ics files without prompting... Can I stop it?

    I use a site that takes my work schedule and generates a .vcs file that I can import into whatever scheduling program I want...
    When I download the file from the website on my PC, it saves it as a .vcs and everything is fine.
    When I do the exact same thing on my Mac, it renames the file to 'calendar.vcs.ics' and iCal complains that the file is bad and can't be imported. If I remove the .ics extension so the file is just 'calendar.vcs' iCal is able to import it just fine.
    Why is the Mac renaming the file when it gets downloads? How can I stop it? I've tried on 2 different G4 Minis with all the latest updates, and I can't find anything to stop it!
    Thanks in advance!
    Jeff
    G4 Mini   Mac OS X (10.4.9)  

    Welcome to Apple Discussions
    It sounds like the file originates as a .vcs file. The Mac is not renaming the file, per se. When downloaded, the Mac (iCal) will by default append the .ics extension since it's eventual home is iCal. Having the .vcs extension already in place prior to the DL is what makes things complicated. iCal will import either file extension, but not both appended.
    Although this example from the Apple Knowledge Base is not related, the resolution is probably the same, i.e. you need to manually remove the extension prior to the import into iCal.

  • Invoke Adobe reader in BB10, how to open encrypted files without prompting for password.

    Hello All,
    I am developing a BB10 application that invokes Adobe Reader as a card for viewing my encrypted pdf books, all books have the same password and I don't want to expose the password to the users to prevent copying copyrighted books. Is it possible to pass the password as parameter when invoking Adobe reader ? if not, is there a trick that can be used to prevent the user from using the options "Share" and "Save As" in card-invoked Adobe reader ?
    Thanks to all.
    Mohanad

    PS Touch can't open PSDs locally. They have to be imported via Creative Cloud (and even then, they are flattened when imported).
    I imagine this was a "quality of life" decision since PS Touch can only support up to 16 layers in a particular project. That and maybe the fact that Photoshop (and Photoshop Elements) can use layer masks, which PS Touch doesn't presently have.

  • Bypassing the replace prompt when replacing a file that already exits

    I want to bypass the "replace prompt" when replacing the file I know already exits.  In the program when I ask it to replace 1 file I know it needs to replace several other different files.  I just want one original promt to replace the file and all other to be bypassed and just have the program replace the file without a promp.  The program uses several "write characters to file" vi and several write to spreedsheet file" vi.

    you can edit the write to spreadsheet and write characters nodes, they are plain VIs.
    Now simply wire a False diagram constant to the advisory dialog input of the open/create/replace node in each of the two mentioned VIs. Giive them a different icon (e.g. change the background color) and save them under a new name elsewhere. Save them in user.lib and they'll even show up in the user palette.
    LabVIEW Champion . Do more with less code and in less time .

  • Portal Access without configuring the Hosts file

    Hello experts,
    Is possible to access the SAP Portal By mentioning the IP address in the URL without configuring the Hosts file?
    Please suggest me.
    Thanks.

    >
    Stars wrote:
    > Hello Baskaran,
    >
    > Thanks for your frequent response. I didnu2019t configure the DNS. If I configure DNS now then it will affects the SAP installation. Please suggest me.
    >
    > Thanks.
    Hallo Stars,
    I am not able to understand the relation between the configuring DNS and affecting SAP installation. If you do not want to do the host file change or DNS configuration, i wonder how could your url request with Ip adress and port knows the physical server to  reach.
    Anyways it is going beyond Webdynpro-ABAP forum to the Networking,systems area. I request Moderators to replace this to appropriate forum.

  • How to replace or remove last 500 bytes of a file without rewriting all the file?

    Hi everyone,
    Usually I only ask for help when I can't find a solution for several days or weeks... And guess what? That just happen!
    So, this is what i am trying to do:
    I have a program to ZIP folder and protect them with password, then it encrypts the zip file.
    That it's working fine, until the user forgets his password.
    So, what I want to do is give the user a Recovery Password option for each ZIP file created. I can't use the Windows Registry because the idea is to be able to recover the password in any computer.So i came up with an idea...
    In simple terms, this will work like this:
    0 - Choose folder to ZIP
    1 - Ask user for recover details (date of birth, email etc)
    2 - ZIP folder with password
    3 - Encrypt ZIP file
    4 - Encrypt recover details and convert it to HEX
    5 - Add recover details (in HEX) to the end of the ZIP file (last bytes)
    6 - Add "5265636F76657244657461696C73" which is the text "RecoverDetails" in HEX
    7 - Add "504B0506000000000000000000000000000000000000" this is the final bytes of a ZIP file and will make the Operating System think that is a ZIP file (i know that will give an error when we try to open it.. the ideia is to change the
    extension later and use my software to do all the work to access this ZIP/folder again)
    So, explaining what it's here, I want to say that I managed how to do all of this so far. The point number 6 will help us to determine where the recover details are in the file, or if they actually exist because user can choose not to use them.
    In order to unlock this ZIP and extract it's contents, I need to reverse what I've done. That means, that  need to read only the last 500 bytes (or less if the file is smaller) of the ZIP and remove those extra bytes I added so the program can check
    if the user is inputing a correct password, and if so decrypt contents and extract them.
    But, if the user insert a wrong password I need to re-add those bytes with the recover details again to the ZIP file.
    The second thing is, if the user forgets his password and asks to recover it, a form will be shown asking to insert the recover detail (date of birth, email etc), so we need to reed the last 500 bytes of the ZIP, find the bytes in number 6 and remove the
    bytes before number 6, remove bytes in number 6 and number 7, and we will have the recover details to match against the user details input.
    I have all done so far with the locking process. But i need help with the unlocking.
    I am not sure if it's possible, but this what i am looking for:
    Read last 500 bytes of a file, remove the bytes with recover details and save the file. Without reading the whole file, because if we have a 1GB file that will take a very long time. Also, i don't want to "waste" hard drive space creating a new
    clone file with 1GB and then delete the original.
    And then add them back "in case user fails the password" which should be exactly the same.
    This sounds a bit confusing I know, even to me, I am writing and trying to explain this the better I can.. Also my English is not the best..
    Here it goes some code to better understanding:
    'READ LAST 500 BYTES OF ZIP FILE TO CHECK IF IT CONTAINS RECOVER DETAILS
    Dim oFileStream As New FileStream(TextBox_ZIP_to_Protect.Text & ".zip", FileMode.Open, FileAccess.Read)
    Dim oBinaryReader As New BinaryReader(oFileStream)
    Dim lBytes As Long = oFileStream.Length
    oBinaryReader.BaseStream.Position = lBytes - 500
    Dim fileData As Byte() = oBinaryReader.ReadBytes(500)
    oBinaryReader.Close()
    oFileStream.Close()
    Dim txtTemp As New System.Text.StringBuilder()
    For Each myByte As Byte In fileData
    txtTemp.Append(myByte.ToString("X2"))
    Next
    Dim RecoveryDetailsPass_Holder = txtTemp.ToString()
    'Dim Temp_2 = txtTemp.ToString()
    'RichTextBox1.Text = txtTemp.ToString()
    If txtTemp.ToString.Contains("505245434F47414653") Then
    'we have password recovery details(the numbers mean RecoverDetails in HEX)
    'next we will get rid of everything before and after of string "cut_at"
    Dim mystr As String = RecoveryDetailsPass_Holder 'RichTextBox1.Text
    Dim cut_at As String = "505245434F47414653"
    Dim x As Integer = InStr(mystr, cut_at)
    ' Dim string_before As String = mystr.Substring(0, x - 1)
    Dim string_after As String = mystr.Substring(x + cut_at.Length - 1)
    RecoveryDetailsPass_Holder = RecoveryDetailsPass_Holder.Replace(string_after.ToString, "")
    RecoveryDetailsPass_Holder = RecoveryDetailsPass_Holder.Replace("505245434F47414653", "") ' this is RecoverDetails in HEX
    RecoveryDetailsPass_Holder = RecoveryDetailsPass_Holder.Replace("504B0506000000000000000000000000000000000000", "") ' this is the bytes of an empty zip file
    'AT THIS POINT WE HAVE ONLY THE RECOVER PASSWORD DETAILS (date of birth, email etc) IN THE VARIABLE "RecoveryDetailsPass_Holder"
    '////////////////////////////////////////////////////// TO DEBUG
    'MsgBox(string_after.ToString & "505245434F47414653")
    'InputBox("", "", string_after.ToString)
    '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ TO DEBUG
    'Temp_2 = Temp_2.Replace(RecoveryDetailsPass_Holder.ToString, "")
    Now that we have the recover details, we need to remove them from ZIP in order to the software try to unzip it with the password provided by the user on the GUI.
    If the user needs to recover the password we have the details already in RecoveryDetailsPass_Holder variable and just need to match them against user input details.
    If the user fails, we need to put the RecoveryDetailsPass_Holder back on the file.
    Any question just ask, it's a bit trick to explain i think, but please ask.
    Anyone know how to do this?
    Many thanks in advanced.
    Nothing is impossible!
    @ Portugal
    Vote if it's helpfull :)

    @ ALL
    Thank you very much for you help. I know that if I'm "playing" with bytes you should assume that I know a lot of VB.net, but I don't know that much unfortunately. I am not a beginner but I am still very fresh and I probably do stuff that work but
    probably not in the best way...
    Anyway, I will explain the idea of this little software I'm making. Once I wanted to create a program to protect folders with password, and I came up with something to change folder permissions to lock access to them, and that actually worked fine and quickly.
    However, I managed how to "crack" the protection by going to folder properties, security tab and then give permissions back to my username. So that, to me, wasn't a safer system to protect folders, also I want the ability to use passwords. So I search
    and search online for a way to do it, and someone replied (to someone with the same question as me) that the best option would be to create a zip with all contents of the folder, with password and then change the extension from .zip to .whatever and register
    the new extension .whatever on the Windows Registry, so that file will have an icon and open with my software.
    So I did...The program zips everything, change the extension and I added the encryption to avoid people changing the extension to ZIP or trying to open with 7-Zip or similar and be able to see the protected files names in the .zip/.whatever
    Answering to all of you now:
    @Armi
    "System.IO.FileStream.SetLength"
    I know I tried that but I erased the code because it didn't work for some reason, I don't remember why sorry, was long time before I created this post.
    The last code I was trying to use was this:
    ' Set the stream position to the desired location of the stream.
    Dim fileStream As IO.FileStream = _
    New IO.FileStream(TextBox_ZIP_to_Protect.Text & ".zip", IO.FileMode.Append)
    Try
    ' Set the stream (OFFSET) position to the desired location of the stream.
    fileStream.Seek(210, IO.SeekOrigin.Current)
    Dim Bytes_do_ZE As Byte() = HexStringToByteArray(Temp_2.ToString)
    'Write Characters ASCII
    For Each Byte_Do_Zeca As Byte In Bytes_do_ZE
    fileStream.WriteByte(Byte_Do_Zeca)
    Next
    Finally
    fileStream.Close()
    End Try
    and we need this:
    Private Shared Function HexStringToByteArray(ByRef strInput As String) As Byte()
    Dim length As Integer
    Dim bOutput As Byte()
    Dim c(1) As Integer
    length = strInput.Length / 2
    ReDim bOutput(length - 1)
    For i As Integer = 0 To (length - 1)
    For j As Integer = 0 To 1
    c(j) = Asc(strInput.Chars(i * 2 + j))
    If ((c(j) >= Asc("0")) And (c(j) <= Asc("9"))) Then
    c(j) = c(j) - Asc("0")
    ElseIf ((c(j) >= Asc("A")) And (c(j) <= Asc("F"))) Then
    c(j) = c(j) - Asc("A") + &HA
    ElseIf ((c(j) >= Asc("a")) And (c(j) <= Asc("f"))) Then
    c(j) = c(j) - Asc("a") + &HA
    End If
    Next j
    bOutput(i) = (c(0) * &H10 + c(1))
    Next i
    Return (bOutput)
    End Function
    That code, as I understand, is to search for the OFFSET of the bytes in the file and start to write from there... That OFFSET should be the beginning of the 500 bytes read on the code before. I got the OFFSET position "210" reading the file with
    the HEX editor "HxD - Hexeditor v1.7.7.0" but using the OFFSET won't work because every file, password, recover details and so on, are different and so the file size, changing the OFFSET I
    think.
    @Reed Kimble
    Does that sound like something which might work for you?
    Thanks for your help. That might be some solution, however it seams a bit of the same problem where we need to read the bytes again to get the recover details. But, as I said in this post, because this is meant to password protect folders, do you think that
    will apply as well?
    @Crazypennie
    Thanks for your reply.
    All this appears really weak. The user has your application since he need it to open the file .... and the code in the application contain the code to read the file without knowing the password. Therefore anyone can read your code and retrieve the
    data without the password ... if he knows VB.
    The application can only open the file if the user didn't use a password to protect the file. Because the file is encrypted and needs to be unencrypted first.
    When the application tries to open/read the file, will need to decrypt it first and then check for a password and do the validation. Also the application is with the code masked/protected which i think it might not be easy for reverse engineering.
    - You need to use a web server and a symmetric key encryption
    This a good idea, besides I don't know how to implement it. However the idea is to be able to:
    1 - Protect a folder anywhere in any Windows computer (portable app)
    2 - Recover password details (security question) in any computer, online and offline
    And I think we need a computer always connected to the Internet to use that method, right?
    @ Mr. Monkeyboy
    Thank you very much for your effort.
    I just wanted to let you know that the zip method you are using is no longer supported.
    I didn't actually knew that. Thanks for letting me know.
    Do you require the compressed encrypted files to actually be Zip files or could they just be compressed files that have nothing to do with Zip?
    No, it doesn't need to be a .zip extension. I am actually using my own extension. It starts as a Zip but then I changed to my own extension which I have registered on the Windows Registry.
    @ ALL
    Thanks again to all for trying and spending time helping me.
    By the way, I might not be able to answer or try any code during the weekend... It's easter break and family is around. Have a nice easter everyone. :)
    Nothing is impossible! Imagination is the limit!

  • Unable to modify/replace/unlock hosts file with admin account

    Hi all,
    I'm having a serious issue when trying to modify the hosts file in Yosemite 10.10.3
    I already tried through the terminal with sudo commands, Get Info window, editing the file externaly and then trying to replace the original hosts with the new but nothing works. Already repaired the disk permisions in case it had to be with the issue but didn't help.
    I'm using an account with admin privileges but it seems I'm not allowed to unlock the file.
    Here is a screenshot of how the GetInfo windows looks like for the hosts file:
    And here is what I get when trying to save from sudo nano /private/etc/hosts
    Any help will be highly welcomed.

         sudo chflags nouchg /private/etc/hosts
    and relock it when you've finished
         sudo chflags uchg /private/etc/hosts
    It's locked for a reason.
    C.

  • Replacing the Header in rule file without changing source file(header defi)

    hi,
    i am loading the data using header in the Source file (.xls).
    I need to load the same file but for diff header (say instead of A1 i need A2) without any changes in source file.
    can someone please provide information that how to change the header in source file without opening/changing source file.
    Thanks in advance
    Anubhav Bisht

    HI SM,
    thanks for reply.
    the Problem is that there is two members in header defined in the source file that i need to change while loading the data.
    the load rule is picking header from the Source file, so replacing in the field is not working..
    do you have any other option/Suggestion.
    Regards
    Anubhav

  • Opening external files directly?(without prompting)

    Hello,
    I'm making a DVD menu in flash. It will open several kinds of files. .mov .avi . ppt . pdf etc.
    But i want to open those files directly, without prompting. When i try to open non web files, a popup window appears, as shown in this screenshot: http://img32.imageshack.us/img32/5188/testtemp.jpg
    Can i remove it?
    I tryied to open the ppt file in the example with this ActionScript 2.0 code:
    on(release)
    getURL("estudo_01.pptx");
    Regards,
    Felipe

    If you're publishing an executable you need to look into the FSCommand functionality and use it to "run" an exec command against your files. Using getURL prompts the system to open the file using the browser, and naturally the browser wants to download the file first.
    Alternatively you can publish (if you have CS4 or up) a native executable using AIR 2.5 that can run simple load and execute the file but that's most likely more complex than just using FSCommand in your current project.
    Here are a couple of links to help you out with that:
    http://www.actionscript.org/forums/showthread.php3?t=18405
    http://www.northcode.com/blog.php/2007/08/14/FSCommand-EXEC-is-Broken-in-Flash-CS3

  • How to replace a native file without deleting it?

    I was wondering if anyone can let me know to replace a native file without deleting it.
    Thanks
    Kalyan

    John
    Thanks for replying. Ok checking in a new revision is not an option. This document belongs to a plant. They have two revisions. One revision is released and other in Genwww. We have identified the issue which has a problem which has links that do not work. So people at plant do not want to check in a new revision as it goes through a 3 step workflow and it involves approvals etc. So best option here is to replace a native file and have the same approvers as what were there for revision 1. Would batch import work? If it does, how would it?
    Thanks
    Chetan

  • Replace a rythmic audio file without re-sequencing

    Hi,
    i composed a song with many variations including kick. It sounds good but the kick i initially choose doesn't work very well. How can i replace the file by another kick sound (without re-programming each sample...) ?
    Thanks a lot

    How can i replace the file by another kick sound
    Using the Drum Replacement feature is a good idea, and it's also a good idea to read about it in the manual (pdf, p. 252) and watch the Apple video ("Drum Replacer"). But it's also easy to get started with it, so I'll tell you how.
    Select the track that contains the kick sound you don't like (I assume that this track contains the kick by itself, and not something else). On the Arrange local menu, select Track > Drum Replacement/Doubling (or press ⌃D). A dialog will appear. Press OK. Now you have a new midi track, containing a new midi region which corresponds with the original audio kick track you selected. The Library is open, and a list of kick sounds is displayed. You can press the down arrow to navigate through those sounds to find one you like.

Maybe you are looking for

  • Reinstalling iTunes after hard drive failure

    My hard drive recently failed and I have just replaced it. Downloaded and installed iTunes again. I had my iTunes library backed up on a external hard drive. I have copied the iTunes library back to internal hard drive prior to installing iTunes - bu

  • Twofold "Importing" question

    Hi! I'm not a beginning programmer, but I am relatively new to Java. This is the first non-hello world app I have done in the language and I've run into some snags (unsurprisingly) :) I'm writing a client program to work with the company's direct-ord

  • Is it possible to have a pop-up in ADF Mobile which automatically fades after a few seconds? how to achieve this?

    I need to have a confirmation message pop-up that fades after 2 seconds of appearance, Is it possible with ADF Mobile?

  • Internal error during pricing in CRM sales order

    Hi,   While creating sales order i am getting following error in sales order   Internal error during pricing.   i am not understading what will be the cause of error   currently working on CRM 7.0 we have replicated all pricing condition types from E

  • Error for font in awt from Adobe Code?

    hi, whenever i start my gui of a text editor i am getting this error code on Debian/Linux with J2SDK 1.4.2. any hints?? java: ../../../src/share/native/sun/awt/font/t2k/t1.c:2171: tsi_T1GetGlyphIndexFromAdobeCode: Assertion `0' failed. Aborted