开发者

How to properly use group access and chgrp?

I attempting to deploy files to a remote server using SSH.

My username joe is a member of the group www.

I am SSH'ing in as joe, and creating a new folder (let's call it test). The parent folder's owners are root:www. When I issue the mkdir /parent/test command over ssh, the owners for the new directory are joe:joe. I'd like the group to be set to www.

If I attempt to issue the command chgrp www /parent/test, I get a permission denied error.

Ultimately, I do开发者_运维技巧n't care about who the owner of the file is, although if the file's owners were www:www that would be nice. I just want to be able to create files on the remote server, while logging in as my username, and then change the group of the files to www.

Thanks in advance.


Try using newgrp before using mkdir to "log in" to a new group

mymachine$ ssh joe@remotemachine
remotemachine$ newgrp www
remotemachine$ mkdir /parent/test
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜