Linux administration, few interesting tips

Change user id (uid) and group id (gid) for specific user

  1. remember current uid, pid for the user you want to do the change
  2. edit /etc/passwd file and update uid, gid for the specific user
  3. edit /etc/group file and update git
  4. stop all software that is run by the user (logoff user)
  5. find all files that belongs to user and change uid
  6. find all files (and directories) that belongs to user group and change gid
  7. re-login
getent passwd | grep myuser
#note two numbers (uid, gid)
#edit passwd, group file and update the old uid, gid to the new one

#find all files with uid (1001 in this example) and change it to 1010, + speed the things up as it sends files in batch
find / -user 1001  -exec chown 1010 {} +
#find all files with gid (1001 in this example) and change it to 1010
find / -group 1001 -exec chown :1010 {} +
No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Linux
Nginx configuration for joplin note taking app

Introduction Joplin may not be the most perfect note-taking application, but it is open-source, well-known, has a long release history, works on multiple operating systems, and supports plugins. It’s not perfect, but it’s good enough and highly usable. In case of this type of application, it is important to have …

Linux
Migrate WordPress site to another hosting service.

IntroductionThis article details the migration of WordPress site (exactly this site you are now on) from one service provider to Amazon Lightsail. There might be various reason to do that (mine is outlined below) but in general I hope to share the message that especially with WordPress, migration can be …

Free(BSD)
Convert pdf file to jpeg – with imagemagic

Short article just to write down not-so frequently (for me) task: remove /opt/homebrew/bin from that command where using on other system than macOs Options: cheers