Skip to main content
7 events
when toggle format what by license comment
Jan 10 at 12:36 history edited Urvin Sanghavi CC BY-SA 4.0
deleted 128 characters in body
Jan 10 at 11:13 comment added terdon Please edit to clarify instead of putting it a comment because comments are easy to miss and can be deleted without warning. We need to know how this will be used, who will be running it. Is it random users on a website? Is it only the root user of the local machine? Are you running this from the command line? Is it going to be linked to a button on a website that users can click? Can't you just run the script itself with sudo?
Jan 10 at 6:18 history edited Urvin Sanghavi CC BY-SA 4.0
deleted 1 character in body
Jan 10 at 5:17 comment added Urvin Sanghavi Sure @terdon, so I want to create dynamic file for host in sites-available folder. I can't access that folder without sudo, so as a programatilcally I want to access and create file and put host related content as you see in above example. Do you have any other approch for that? let me know Thanks
Jan 9 at 14:05 comment added terdon Why would you want to do this? Can you give us come context? You cannot use sudo in non-interactive scripts unless you set it up to work without a password which is a very, very bad idea. Such things are usually done by running the script itself with sudo but that can also be dangerous. So if you explain what your final goal is (do you want a webpage with a button that does things? Will you be running this manually? Something else?) we can try and give you a good solution.
S Jan 9 at 10:21 review First questions
Jan 9 at 10:30
S Jan 9 at 10:21 history asked Urvin Sanghavi CC BY-SA 4.0