voodish logo
tweet rss book of faces Linked In

How to change Linux User (UID) and Group (GID)

From SSH you can easily change the UID and GID by using the chown command. Shown below is the structure of the command and how to use it to change Group and User id’s. This is especially useful if you are having problems transferring files using FTP.

Change both UID and GID

Login as root user with SSH.

chown -R newuserID:newgroupID folder_name

To give you a working example.

If the folder you wanted to change was test_folder and
the group ID was testgroup and
the user ID was testuser, then you would use the following command:

chown -R testuser:testgroup test_folder

Note: the -R means to change recursively, so that the user and group ID are changed for all files and folders within the parent folder; simply leave out -R if you only want to affect the parent folder

Just change User ID (UID)

If you would like to just change the user ID and not the group ID, then using the example above use the following command:

Login as root user with SSH.

chown testuser test_folder

Related Articles

Comments RSS Feed

1 Comments

  1. sw33t February 4, 2011

    sweeet, cheers for that, nice and simple explan.

  2. Go to Top of the page

Leave a comment