0

If I run id -a on my remote host it shows a different set of groups if I run ssh [remote_host] "id -a". I would expect both to return the same set of groups as I am the same user in both cases.

I am trying to run a chgrp command using ssh to change the group of a directory of files. However, it appears my user is not in the group I am trying to change to, so I don't have permissions. If I ssh into my server I am in the group and am able to run chgrp successfully.

Why would my group ownership change depending on if I am running the command over ssh?

remote@website:~$ id -a uid=1000(remote) gid=1000(remote) groups=1000(remote),33(www-data)

local@computer:~$ ssh remote@website "id -a" uid=1000(remote) gid=1000(remote) groups=1000(remote)

  • Can you include what you are trying to achieve. You are writing running `chgrp` which changes the group ownership of files or folders, but "...group I am trying to change to.." indicates that you want to change the effective group of that user. That command would be `newgrp`. So depending if you want to change group ownership of files/folders or want to have a different effective group you have to either run `chgrp` or `newgrp`. – Thomas Nov 12 '17 at 15:14
  • @Thomas I am trying to change the group ownership of a set of files, I believe `chgrp` is correct. I have updated the question as well. – Michael Ozeryansky Nov 12 '17 at 22:29

0 Answers0