How can I run dotnet on ubuntu without using sudo?











up vote
3
down vote

favorite












I've been trying to update the permissions so that I can run a command (specificially dotnet restore). I'm not sure if this issue is specific to running dotnet, or if it is more generic.



I can run the command using sudo dotnet restore, however I want to be able to run this command without sudo. This is because I want to execute these commands via a CI tool (Jenkins), and I don't want that tool to have access to root commands. . The Jenkins user is unable to run dotnet restore (because of the errors below) or sudo dotnet restore (because it doesn't have root access).



When I run without sudo, I have the following errors from dotnet restore:



/usr/share/dotnet/sdk/2.1.104/NuGet.targets(104,5): error : Access to the path '/{file_path_to_project.csproj}/obj' is denied. 
[{file_path_to_project.csproj}]
/usr/share/dotnet/sdk/2.1.104/NuGet.targets(104,5): error : Permission denied [{file_path_to_project.csproj}]


I've been trying to update the read and write permissions for my user on the /usr/share/dotnet/sdk/2.1.104/NuGet.targets file, and the {file_path_to_project.csproj} directory, but so far I still get the same errors. Does it have something to do with the /obj directory? – When I run ls the obj file is not shown.



How can I update the permissions so that I can access these files without running sudo?



I created a /etc/sudoers.d/dotnet file to see if it would enable dotnet to be run without needing to call sudo. I added the following contents: {myusername} {myhostname} = (root) NOPASSWD: /usr/bin/dotnet. However, this still required me to run sudo before dotnet restore to get the correct output.










share|improve this question




















  • 1




    Comments are not for extended discussion; this conversation has been moved to chat.
    – Thomas Ward
    Apr 24 at 19:38










  • Would you please edit and clarify about the CI tool you're using? What is it, how does it operate? If you can run dotnet restore via it, why can't you do the same with sudo dotnet restore even without it having root permissions?
    – dessert
    Apr 25 at 6:39

















up vote
3
down vote

favorite












I've been trying to update the permissions so that I can run a command (specificially dotnet restore). I'm not sure if this issue is specific to running dotnet, or if it is more generic.



I can run the command using sudo dotnet restore, however I want to be able to run this command without sudo. This is because I want to execute these commands via a CI tool (Jenkins), and I don't want that tool to have access to root commands. . The Jenkins user is unable to run dotnet restore (because of the errors below) or sudo dotnet restore (because it doesn't have root access).



When I run without sudo, I have the following errors from dotnet restore:



/usr/share/dotnet/sdk/2.1.104/NuGet.targets(104,5): error : Access to the path '/{file_path_to_project.csproj}/obj' is denied. 
[{file_path_to_project.csproj}]
/usr/share/dotnet/sdk/2.1.104/NuGet.targets(104,5): error : Permission denied [{file_path_to_project.csproj}]


I've been trying to update the read and write permissions for my user on the /usr/share/dotnet/sdk/2.1.104/NuGet.targets file, and the {file_path_to_project.csproj} directory, but so far I still get the same errors. Does it have something to do with the /obj directory? – When I run ls the obj file is not shown.



How can I update the permissions so that I can access these files without running sudo?



I created a /etc/sudoers.d/dotnet file to see if it would enable dotnet to be run without needing to call sudo. I added the following contents: {myusername} {myhostname} = (root) NOPASSWD: /usr/bin/dotnet. However, this still required me to run sudo before dotnet restore to get the correct output.










share|improve this question




















  • 1




    Comments are not for extended discussion; this conversation has been moved to chat.
    – Thomas Ward
    Apr 24 at 19:38










  • Would you please edit and clarify about the CI tool you're using? What is it, how does it operate? If you can run dotnet restore via it, why can't you do the same with sudo dotnet restore even without it having root permissions?
    – dessert
    Apr 25 at 6:39















up vote
3
down vote

favorite









up vote
3
down vote

favorite











I've been trying to update the permissions so that I can run a command (specificially dotnet restore). I'm not sure if this issue is specific to running dotnet, or if it is more generic.



I can run the command using sudo dotnet restore, however I want to be able to run this command without sudo. This is because I want to execute these commands via a CI tool (Jenkins), and I don't want that tool to have access to root commands. . The Jenkins user is unable to run dotnet restore (because of the errors below) or sudo dotnet restore (because it doesn't have root access).



When I run without sudo, I have the following errors from dotnet restore:



/usr/share/dotnet/sdk/2.1.104/NuGet.targets(104,5): error : Access to the path '/{file_path_to_project.csproj}/obj' is denied. 
[{file_path_to_project.csproj}]
/usr/share/dotnet/sdk/2.1.104/NuGet.targets(104,5): error : Permission denied [{file_path_to_project.csproj}]


I've been trying to update the read and write permissions for my user on the /usr/share/dotnet/sdk/2.1.104/NuGet.targets file, and the {file_path_to_project.csproj} directory, but so far I still get the same errors. Does it have something to do with the /obj directory? – When I run ls the obj file is not shown.



How can I update the permissions so that I can access these files without running sudo?



I created a /etc/sudoers.d/dotnet file to see if it would enable dotnet to be run without needing to call sudo. I added the following contents: {myusername} {myhostname} = (root) NOPASSWD: /usr/bin/dotnet. However, this still required me to run sudo before dotnet restore to get the correct output.










share|improve this question















I've been trying to update the permissions so that I can run a command (specificially dotnet restore). I'm not sure if this issue is specific to running dotnet, or if it is more generic.



I can run the command using sudo dotnet restore, however I want to be able to run this command without sudo. This is because I want to execute these commands via a CI tool (Jenkins), and I don't want that tool to have access to root commands. . The Jenkins user is unable to run dotnet restore (because of the errors below) or sudo dotnet restore (because it doesn't have root access).



When I run without sudo, I have the following errors from dotnet restore:



/usr/share/dotnet/sdk/2.1.104/NuGet.targets(104,5): error : Access to the path '/{file_path_to_project.csproj}/obj' is denied. 
[{file_path_to_project.csproj}]
/usr/share/dotnet/sdk/2.1.104/NuGet.targets(104,5): error : Permission denied [{file_path_to_project.csproj}]


I've been trying to update the read and write permissions for my user on the /usr/share/dotnet/sdk/2.1.104/NuGet.targets file, and the {file_path_to_project.csproj} directory, but so far I still get the same errors. Does it have something to do with the /obj directory? – When I run ls the obj file is not shown.



How can I update the permissions so that I can access these files without running sudo?



I created a /etc/sudoers.d/dotnet file to see if it would enable dotnet to be run without needing to call sudo. I added the following contents: {myusername} {myhostname} = (root) NOPASSWD: /usr/bin/dotnet. However, this still required me to run sudo before dotnet restore to get the correct output.







command-line permissions sudo dotnet






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 25 at 13:15

























asked Apr 23 at 20:48









fuzzi

1315




1315








  • 1




    Comments are not for extended discussion; this conversation has been moved to chat.
    – Thomas Ward
    Apr 24 at 19:38










  • Would you please edit and clarify about the CI tool you're using? What is it, how does it operate? If you can run dotnet restore via it, why can't you do the same with sudo dotnet restore even without it having root permissions?
    – dessert
    Apr 25 at 6:39
















  • 1




    Comments are not for extended discussion; this conversation has been moved to chat.
    – Thomas Ward
    Apr 24 at 19:38










  • Would you please edit and clarify about the CI tool you're using? What is it, how does it operate? If you can run dotnet restore via it, why can't you do the same with sudo dotnet restore even without it having root permissions?
    – dessert
    Apr 25 at 6:39










1




1




Comments are not for extended discussion; this conversation has been moved to chat.
– Thomas Ward
Apr 24 at 19:38




Comments are not for extended discussion; this conversation has been moved to chat.
– Thomas Ward
Apr 24 at 19:38












Would you please edit and clarify about the CI tool you're using? What is it, how does it operate? If you can run dotnet restore via it, why can't you do the same with sudo dotnet restore even without it having root permissions?
– dessert
Apr 25 at 6:39






Would you please edit and clarify about the CI tool you're using? What is it, how does it operate? If you can run dotnet restore via it, why can't you do the same with sudo dotnet restore even without it having root permissions?
– dessert
Apr 25 at 6:39












1 Answer
1






active

oldest

votes

















up vote
0
down vote













One possibility is to use mono instead of dotnet. It's an open source implementation of the .NET framework and doesn't require root permission to run. It supports almost all of the .NET 4.7 features (see https://www.mono-project.com/docs/about-mono/compatibility/ for exceptions).






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1027592%2fhow-can-i-run-dotnet-on-ubuntu-without-using-sudo%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    One possibility is to use mono instead of dotnet. It's an open source implementation of the .NET framework and doesn't require root permission to run. It supports almost all of the .NET 4.7 features (see https://www.mono-project.com/docs/about-mono/compatibility/ for exceptions).






    share|improve this answer

























      up vote
      0
      down vote













      One possibility is to use mono instead of dotnet. It's an open source implementation of the .NET framework and doesn't require root permission to run. It supports almost all of the .NET 4.7 features (see https://www.mono-project.com/docs/about-mono/compatibility/ for exceptions).






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        One possibility is to use mono instead of dotnet. It's an open source implementation of the .NET framework and doesn't require root permission to run. It supports almost all of the .NET 4.7 features (see https://www.mono-project.com/docs/about-mono/compatibility/ for exceptions).






        share|improve this answer












        One possibility is to use mono instead of dotnet. It's an open source implementation of the .NET framework and doesn't require root permission to run. It supports almost all of the .NET 4.7 features (see https://www.mono-project.com/docs/about-mono/compatibility/ for exceptions).







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 24 at 2:13









        Peter Selinger

        262




        262






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1027592%2fhow-can-i-run-dotnet-on-ubuntu-without-using-sudo%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

            Mangá

             ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕