Click to See Complete Forum and Search --> : how to remotely change user properties


eXtremist
03-23-2001, 10:35 AM
I just noticed that when I log in, I am user 'greg' and group 'greg'. I want to be group 'user'.

How can I change this (command line) remotely?

bdg1983
03-23-2001, 02:48 PM
First make sure you have a group called "user" (if you don't use addgroup to create it). Then get the id of the "user" group, which can be found by looking in /etc/groups (the entry should look something like "user:x:1003:", and "1003" would be the group id). Then you can edit /etc/passwd, where you should see an entry like this: "some_user:x:1000:1000:Unknown User,,,:/home/some_user:/bin/bash"
The first number you see there is the user id, which shouldn't be changed, and the second is the group id, which you should change to whatever the "user" group id is.

DISCLAIMER: There is probobaly a better way to do this. I just don't know it. Also, be very careful when editing /etc/passwd and /etc/groups, screwing up these files can make your system unbootable.