SSH configuration: chown username:group: says invalid user

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












My Ubuntu16.04.4 server has username: graycodes



THE ERROR OUTPUT:



chown: invalid user: 'vagrant:vagrant'


I'm setting file permissions for OpenSSH.
What I'd like is to keep my username as graycodes and define the permisions using this username in place of the username vagrant.



chown -R vagrant:vagrant .ssh


I understand it reads as:



chown -R username:group file name


I've also tried firstly:



chown -R graycodes:vagrant .ssh


but it's not working. Do I have no choice but to make my server username as vagrant?



I believe this may work to add 'graycodes' to the group 'vagrant'.



$ groups
$ sudo usermod -a -G vagrant $USER
$ exec su -l $USER
$ groups









share|improve this question



























    up vote
    0
    down vote

    favorite












    My Ubuntu16.04.4 server has username: graycodes



    THE ERROR OUTPUT:



    chown: invalid user: 'vagrant:vagrant'


    I'm setting file permissions for OpenSSH.
    What I'd like is to keep my username as graycodes and define the permisions using this username in place of the username vagrant.



    chown -R vagrant:vagrant .ssh


    I understand it reads as:



    chown -R username:group file name


    I've also tried firstly:



    chown -R graycodes:vagrant .ssh


    but it's not working. Do I have no choice but to make my server username as vagrant?



    I believe this may work to add 'graycodes' to the group 'vagrant'.



    $ groups
    $ sudo usermod -a -G vagrant $USER
    $ exec su -l $USER
    $ groups









    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      My Ubuntu16.04.4 server has username: graycodes



      THE ERROR OUTPUT:



      chown: invalid user: 'vagrant:vagrant'


      I'm setting file permissions for OpenSSH.
      What I'd like is to keep my username as graycodes and define the permisions using this username in place of the username vagrant.



      chown -R vagrant:vagrant .ssh


      I understand it reads as:



      chown -R username:group file name


      I've also tried firstly:



      chown -R graycodes:vagrant .ssh


      but it's not working. Do I have no choice but to make my server username as vagrant?



      I believe this may work to add 'graycodes' to the group 'vagrant'.



      $ groups
      $ sudo usermod -a -G vagrant $USER
      $ exec su -l $USER
      $ groups









      share|improve this question















      My Ubuntu16.04.4 server has username: graycodes



      THE ERROR OUTPUT:



      chown: invalid user: 'vagrant:vagrant'


      I'm setting file permissions for OpenSSH.
      What I'd like is to keep my username as graycodes and define the permisions using this username in place of the username vagrant.



      chown -R vagrant:vagrant .ssh


      I understand it reads as:



      chown -R username:group file name


      I've also tried firstly:



      chown -R graycodes:vagrant .ssh


      but it's not working. Do I have no choice but to make my server username as vagrant?



      I believe this may work to add 'graycodes' to the group 'vagrant'.



      $ groups
      $ sudo usermod -a -G vagrant $USER
      $ exec su -l $USER
      $ groups






      ubuntu ssh users chown vagrant






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 19 at 18:12

























      asked Sep 19 at 17:53









      Gray

      175




      175




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          There are a few things to take into consideration and I hope I'll cover some holes in your question.



          First, when you use chown, the user and group you're trying to assign the entities to should exist. If it doesn't, then you'll get an error. So make sure it does exist first.



          Second, to use chown, you need some elevated powers. You can't just move ownership of files, etc, to another user as a regular user yourself. Make sure you know what this means and that that's what you want.



          Third, make sure you understand what you're trying to do. chown changes the ownership of a filesystem entity or entities to the user and group you tell it.






          share|improve this answer




















          • Then I believe I would need to add my user 'graycodes' to the group 'vagrant' which would give it permission in Vagrant. I figure the relevant commands could look like I've show in my edited question.
            – Gray
            Sep 19 at 18:09







          • 2




            @Gray It's still not clear to me what in fact you are trying to achieve.
            – Tomasz
            Sep 19 at 18:10










          • okay. I'm actually following the sitepoint base-box tutorial. I'm packaging a base box which I'll later provision an a LAMP server and then add wordpress to that. Here's the link to the sitepoint tutorial: sitepoint.com/create-share-vagrant-base-box (under subheading 'SSH configuration'..."Open SSH is very strict about this folder and file permission. So let's change it to the correct one.")
            – Gray
            Sep 19 at 18:16










          • @Gray That tutorial goes pretty much against my intuition and experience with Vagrant. My experience is distant, but I thought Vagrant is for fast and easy creation of virtual machines, while the tutorial makes this manual. Why use Vagrant then? Quite likely I'm not in the story. So abstracting from this, there's no step included in the tutorial where you'd install Vagrant itself. This plus the "invalid user" error makes me think you still miss the actual vagrant on your system. Am I wrong?
            – Tomasz
            Sep 19 at 18:29










          • shift, I dnk what I'm doing. But I know how to do it one way. The way the tutorial says I should. But that means my username on the server HAS TO BE 'vagrant'.
            – Gray
            Sep 19 at 18:34










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f470084%2fssh-configuration-chown-usernamegroup-says-invalid-user%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          There are a few things to take into consideration and I hope I'll cover some holes in your question.



          First, when you use chown, the user and group you're trying to assign the entities to should exist. If it doesn't, then you'll get an error. So make sure it does exist first.



          Second, to use chown, you need some elevated powers. You can't just move ownership of files, etc, to another user as a regular user yourself. Make sure you know what this means and that that's what you want.



          Third, make sure you understand what you're trying to do. chown changes the ownership of a filesystem entity or entities to the user and group you tell it.






          share|improve this answer




















          • Then I believe I would need to add my user 'graycodes' to the group 'vagrant' which would give it permission in Vagrant. I figure the relevant commands could look like I've show in my edited question.
            – Gray
            Sep 19 at 18:09







          • 2




            @Gray It's still not clear to me what in fact you are trying to achieve.
            – Tomasz
            Sep 19 at 18:10










          • okay. I'm actually following the sitepoint base-box tutorial. I'm packaging a base box which I'll later provision an a LAMP server and then add wordpress to that. Here's the link to the sitepoint tutorial: sitepoint.com/create-share-vagrant-base-box (under subheading 'SSH configuration'..."Open SSH is very strict about this folder and file permission. So let's change it to the correct one.")
            – Gray
            Sep 19 at 18:16










          • @Gray That tutorial goes pretty much against my intuition and experience with Vagrant. My experience is distant, but I thought Vagrant is for fast and easy creation of virtual machines, while the tutorial makes this manual. Why use Vagrant then? Quite likely I'm not in the story. So abstracting from this, there's no step included in the tutorial where you'd install Vagrant itself. This plus the "invalid user" error makes me think you still miss the actual vagrant on your system. Am I wrong?
            – Tomasz
            Sep 19 at 18:29










          • shift, I dnk what I'm doing. But I know how to do it one way. The way the tutorial says I should. But that means my username on the server HAS TO BE 'vagrant'.
            – Gray
            Sep 19 at 18:34














          up vote
          1
          down vote



          accepted










          There are a few things to take into consideration and I hope I'll cover some holes in your question.



          First, when you use chown, the user and group you're trying to assign the entities to should exist. If it doesn't, then you'll get an error. So make sure it does exist first.



          Second, to use chown, you need some elevated powers. You can't just move ownership of files, etc, to another user as a regular user yourself. Make sure you know what this means and that that's what you want.



          Third, make sure you understand what you're trying to do. chown changes the ownership of a filesystem entity or entities to the user and group you tell it.






          share|improve this answer




















          • Then I believe I would need to add my user 'graycodes' to the group 'vagrant' which would give it permission in Vagrant. I figure the relevant commands could look like I've show in my edited question.
            – Gray
            Sep 19 at 18:09







          • 2




            @Gray It's still not clear to me what in fact you are trying to achieve.
            – Tomasz
            Sep 19 at 18:10










          • okay. I'm actually following the sitepoint base-box tutorial. I'm packaging a base box which I'll later provision an a LAMP server and then add wordpress to that. Here's the link to the sitepoint tutorial: sitepoint.com/create-share-vagrant-base-box (under subheading 'SSH configuration'..."Open SSH is very strict about this folder and file permission. So let's change it to the correct one.")
            – Gray
            Sep 19 at 18:16










          • @Gray That tutorial goes pretty much against my intuition and experience with Vagrant. My experience is distant, but I thought Vagrant is for fast and easy creation of virtual machines, while the tutorial makes this manual. Why use Vagrant then? Quite likely I'm not in the story. So abstracting from this, there's no step included in the tutorial where you'd install Vagrant itself. This plus the "invalid user" error makes me think you still miss the actual vagrant on your system. Am I wrong?
            – Tomasz
            Sep 19 at 18:29










          • shift, I dnk what I'm doing. But I know how to do it one way. The way the tutorial says I should. But that means my username on the server HAS TO BE 'vagrant'.
            – Gray
            Sep 19 at 18:34












          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          There are a few things to take into consideration and I hope I'll cover some holes in your question.



          First, when you use chown, the user and group you're trying to assign the entities to should exist. If it doesn't, then you'll get an error. So make sure it does exist first.



          Second, to use chown, you need some elevated powers. You can't just move ownership of files, etc, to another user as a regular user yourself. Make sure you know what this means and that that's what you want.



          Third, make sure you understand what you're trying to do. chown changes the ownership of a filesystem entity or entities to the user and group you tell it.






          share|improve this answer












          There are a few things to take into consideration and I hope I'll cover some holes in your question.



          First, when you use chown, the user and group you're trying to assign the entities to should exist. If it doesn't, then you'll get an error. So make sure it does exist first.



          Second, to use chown, you need some elevated powers. You can't just move ownership of files, etc, to another user as a regular user yourself. Make sure you know what this means and that that's what you want.



          Third, make sure you understand what you're trying to do. chown changes the ownership of a filesystem entity or entities to the user and group you tell it.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Sep 19 at 17:59









          Tomasz

          8,43552560




          8,43552560











          • Then I believe I would need to add my user 'graycodes' to the group 'vagrant' which would give it permission in Vagrant. I figure the relevant commands could look like I've show in my edited question.
            – Gray
            Sep 19 at 18:09







          • 2




            @Gray It's still not clear to me what in fact you are trying to achieve.
            – Tomasz
            Sep 19 at 18:10










          • okay. I'm actually following the sitepoint base-box tutorial. I'm packaging a base box which I'll later provision an a LAMP server and then add wordpress to that. Here's the link to the sitepoint tutorial: sitepoint.com/create-share-vagrant-base-box (under subheading 'SSH configuration'..."Open SSH is very strict about this folder and file permission. So let's change it to the correct one.")
            – Gray
            Sep 19 at 18:16










          • @Gray That tutorial goes pretty much against my intuition and experience with Vagrant. My experience is distant, but I thought Vagrant is for fast and easy creation of virtual machines, while the tutorial makes this manual. Why use Vagrant then? Quite likely I'm not in the story. So abstracting from this, there's no step included in the tutorial where you'd install Vagrant itself. This plus the "invalid user" error makes me think you still miss the actual vagrant on your system. Am I wrong?
            – Tomasz
            Sep 19 at 18:29










          • shift, I dnk what I'm doing. But I know how to do it one way. The way the tutorial says I should. But that means my username on the server HAS TO BE 'vagrant'.
            – Gray
            Sep 19 at 18:34
















          • Then I believe I would need to add my user 'graycodes' to the group 'vagrant' which would give it permission in Vagrant. I figure the relevant commands could look like I've show in my edited question.
            – Gray
            Sep 19 at 18:09







          • 2




            @Gray It's still not clear to me what in fact you are trying to achieve.
            – Tomasz
            Sep 19 at 18:10










          • okay. I'm actually following the sitepoint base-box tutorial. I'm packaging a base box which I'll later provision an a LAMP server and then add wordpress to that. Here's the link to the sitepoint tutorial: sitepoint.com/create-share-vagrant-base-box (under subheading 'SSH configuration'..."Open SSH is very strict about this folder and file permission. So let's change it to the correct one.")
            – Gray
            Sep 19 at 18:16










          • @Gray That tutorial goes pretty much against my intuition and experience with Vagrant. My experience is distant, but I thought Vagrant is for fast and easy creation of virtual machines, while the tutorial makes this manual. Why use Vagrant then? Quite likely I'm not in the story. So abstracting from this, there's no step included in the tutorial where you'd install Vagrant itself. This plus the "invalid user" error makes me think you still miss the actual vagrant on your system. Am I wrong?
            – Tomasz
            Sep 19 at 18:29










          • shift, I dnk what I'm doing. But I know how to do it one way. The way the tutorial says I should. But that means my username on the server HAS TO BE 'vagrant'.
            – Gray
            Sep 19 at 18:34















          Then I believe I would need to add my user 'graycodes' to the group 'vagrant' which would give it permission in Vagrant. I figure the relevant commands could look like I've show in my edited question.
          – Gray
          Sep 19 at 18:09





          Then I believe I would need to add my user 'graycodes' to the group 'vagrant' which would give it permission in Vagrant. I figure the relevant commands could look like I've show in my edited question.
          – Gray
          Sep 19 at 18:09





          2




          2




          @Gray It's still not clear to me what in fact you are trying to achieve.
          – Tomasz
          Sep 19 at 18:10




          @Gray It's still not clear to me what in fact you are trying to achieve.
          – Tomasz
          Sep 19 at 18:10












          okay. I'm actually following the sitepoint base-box tutorial. I'm packaging a base box which I'll later provision an a LAMP server and then add wordpress to that. Here's the link to the sitepoint tutorial: sitepoint.com/create-share-vagrant-base-box (under subheading 'SSH configuration'..."Open SSH is very strict about this folder and file permission. So let's change it to the correct one.")
          – Gray
          Sep 19 at 18:16




          okay. I'm actually following the sitepoint base-box tutorial. I'm packaging a base box which I'll later provision an a LAMP server and then add wordpress to that. Here's the link to the sitepoint tutorial: sitepoint.com/create-share-vagrant-base-box (under subheading 'SSH configuration'..."Open SSH is very strict about this folder and file permission. So let's change it to the correct one.")
          – Gray
          Sep 19 at 18:16












          @Gray That tutorial goes pretty much against my intuition and experience with Vagrant. My experience is distant, but I thought Vagrant is for fast and easy creation of virtual machines, while the tutorial makes this manual. Why use Vagrant then? Quite likely I'm not in the story. So abstracting from this, there's no step included in the tutorial where you'd install Vagrant itself. This plus the "invalid user" error makes me think you still miss the actual vagrant on your system. Am I wrong?
          – Tomasz
          Sep 19 at 18:29




          @Gray That tutorial goes pretty much against my intuition and experience with Vagrant. My experience is distant, but I thought Vagrant is for fast and easy creation of virtual machines, while the tutorial makes this manual. Why use Vagrant then? Quite likely I'm not in the story. So abstracting from this, there's no step included in the tutorial where you'd install Vagrant itself. This plus the "invalid user" error makes me think you still miss the actual vagrant on your system. Am I wrong?
          – Tomasz
          Sep 19 at 18:29












          shift, I dnk what I'm doing. But I know how to do it one way. The way the tutorial says I should. But that means my username on the server HAS TO BE 'vagrant'.
          – Gray
          Sep 19 at 18:34




          shift, I dnk what I'm doing. But I know how to do it one way. The way the tutorial says I should. But that means my username on the server HAS TO BE 'vagrant'.
          – Gray
          Sep 19 at 18:34

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f470084%2fssh-configuration-chown-usernamegroup-says-invalid-user%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?