Linux change owner or owning group

Source: Internet
Author: User

Change owner and owning group
Chown:change Ownerchgrp:change Group
1. Change the Owner
> View all users of the current system
[[Email protected] tmp]# cat /etc/passwdroot:x:0:0:root:/root:/bin/bashbin:x:1:1:bin:/bin :/sbin/nologindaemon:x:2:2:daemon:/sbin:/sbin/nologinadm:x:3:4:adm:/var/adm:/sbin/nologinlp:x:4:7:lp:/var/ spool/lpd:/sbin/nologinsync:x:5:0:sync:/sbin:/bin/syncshutdown:x:6:0:shutdown:/sbin:/sbin/shutdownhalt:x:7:0: halt:/sbin:/sbin/haltmail:x:8:12:mail:/var/spool/mail:/sbin/nologinoperator:x:11:0:operator:/root:/sbin/ Nologingames:x:12:100:games:/usr/games:/sbin/nologinftp:x:14:50:ftp user:/var/ftp:/sbin/nologinnobody:x : 99:99:nobody:/:/sbin/nologinsystemd-bus-proxy:x:999:997:systemd bus proxy:/:/sbin/ nologinsystemd-network:x:192:192:systemd network management:/:/sbin/nologindbus:x:81:81:system  MESSAGE BUS:/:/SBIN/NOLOGINPOLKITD:X:998:996:USER FOR POLKITD:/:/SBIN/NOLOGINTSS:X:59:59: account used by the trousers package to sandbox the tcsd   daemon:/dev/null:/sbin/nologinpostfix:x:89:89::/var/spool/postfix:/sbin/nologinsshd:x:74:74:privilege-separated ssh:/var/empty/sshd:/sbin/ Nologinchrony:x:997:995::/var/lib/chrony:/sbin/nologinallin1:x:1000:1000::/home/allin1:/bin/bash

In addition to the final allin1 is the new user we created, the others are the system comes with the user

> Change the owner of a file/directory

650) this.width=650; "src=" Http://oqjg6c4c1.bkt.clouddn.com/201706081526_298.png "style=" border-style:none; "/>

2. Change the owning group
> Change the owning Group of a file/directory

650) this.width=650; "src=" Http://oqjg6c4c1.bkt.clouddn.com/201706081530_530.png "style=" border-style:none; "/>

3. Powerful Chown command
> Chown command, not only can modify the file/directory owner, you can also modify the owning group 1. Change owner and owning group at the same time
Chown Root:root 2.txt

650) this.width=650; "src=" Http://oqjg6c4c1.bkt.clouddn.com/201706081532_855.png "style=" border-style:none; "/>

2. Change only the owning group
Chown:user1 2.txt

650) this.width=650; "src=" Http://oqjg6c4c1.bkt.clouddn.com/201706081534_246.png "style=" border-style:none; "/>

-ROptions
> Change directory and the owner and owning group of all subdirectories/files under directory

650) this.width=650; "src=" Http://oqjg6c4c1.bkt.clouddn.com/201706081557_784.png "style=" border-style:none; "/>


This article is from the "Linux Road" blog, make sure to keep this source http://allin28.blog.51cto.com/12931477/1933855

Linux change owner or owning group

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.