Tag Info

New answers tagged

0

Bash Reference Manual says: Bash attempts completion treating the text as username (if the text begins with ‘~’) Bash uses getpwent function for completion. man getpwent on OSX says: These functions obtain information from opendirectoryd(8), including records in /etc/master.passwd which is described in master.passwd(5).


2

users counts login sessions. From sudo: The su command is used to become another user during a login session. (Emphasis is mine.) A login session creates a new tty, where as su uses the existing tty. I just looked at the source code to the users command. What it does is read utmp. So I guess the bottom line is that if you write a program and write ...


0

I've developed a patch for rsync that complains if the user doesn't exist on the destination. Here it is, I'm using it together with roaima's listing of users. diff -ur rsync-3.1.1-orig/uidlist.c rsync-3.1.1/uidlist.c --- rsync-3.1.1-orig/uidlist.c 2014-04-30 13:34:15.000000000 -0600 +++ rsync-3.1.1/uidlist.c 2015-06-15 10:03:50.282216140 -0600 @@ ...


2

The rsync command doesn't have a mechanism for handling this directly, so I would use a different approach. I would scan the source filesystem tree, collecting the usernames (and groups) of all files present there: # List of usernames owning files under 'src' find src -printf "%u\n" | sort -u | tee /tmp/src.users # List of group memberships for files under ...


0

You need to grant access to X server for other users /usr/bin/xhost + You can read about xhost in man page: XHOST(1) NAME xhost - server access control program for X ... ... ... + Access is granted to everyone, even if they aren't on the list (i.e., access control is turned off). ... ... ...


0

Export a different display before trying to open an X11 connection: export DISPLAY=:1 Then launch your GUI and it should work.


3

There is no record or log kept of which user was responsible for creating each user. Technically, all users are created by root anyway.


0

If you're running Ubuntu, and if the user you want to login as doesn't have a password set: sudo su - username Enter your own password and you should be set. Of course, this requires that your user has rights to gain root privileges with sudo.


0

Seems like a rather pointless exercise. Target process not only may not have all rights necessary to switch credentials, it may have its uid/gid stored somewhere and actively used, so a surprise credential change may actually break things. There are various entities which know who owns them - files, sysv ipc. So you would need to /stop/ all target ...


1

Very interesting attempt. Actually, process's supplementary groups (defined in /etc/group) are set by setgroups system call. It requires CAP_SETGID privilege or being root. So you can do like this: # id uid=0(root) gid=0(root) groups=0(root) # gdb -q id Reading symbols from id...(no debugging symbols found)...done. (gdb) b getgroups Breakpoint 1 at ...


0

How about something like this: #!/bin/bash while read ID do groups $ID done < input.file | awk '{print $3}' | sort | uniq > list_of_groups That gets you a lexically-sorted unique list of group names.


3

Read the file line by line, call groups for each item: while read name ; do groups "$name" ; done < list.txt > with_groups.txt Loops can often be replaced by xargs: xargs groups < list.txt > with_groups.txt


0

Try loginning in as a root and running the following command: # usermod pagagne:pagagne ccote-jponchar-gnicolas


4

The user pagagne will need to logout and login to his/her shell for the group to be visible in his groups. You could also check if the user has indeed been added to the group: groups pagagne



Top 50 recent answers are included