Hot answers tagged

6

As @schily says, in the ping utilility (and others), the root permissions are dropped after they are no longer necessary. This is done for security reasons. From ping.c - main() - the user is dropped with the getuid and setuid call. getuid() gets the current user, and root doing a setuid() will change the uid of the process. /* * Pull this stuff up front ...


6

Archive::Tar or similar software would be one method. % touch foo % tar cvf x foo foo % tar tvf x -rw-rw-r-- 1 jdoe12 jdoe12 0 May 6 20:36 foo % perl -MArchive::Tar -e '$t=Archive::Tar->new;$t->read("x");$t->chown("foo","root");$t->write("y")' % tar tvf y -rw-rw-r-- 1 root jdoe12 0 May 6 20:36 foo %


3

It is not just being logged in as the olduser, but also if the olduser id is running any processes on the system. If you search the output of ps -ef|grep olduser you may see the processes it is running. Actually, the error message is telling you the PID of the process it is running (the <number> in your question headline) You can kill the process or ...


3

The general sense of @rui-f-ribeiro remark is correct, but the details are not. Details matter. Ubuntu uses these packages: iputils-ping passwd The ping utility resets permissions in a function named limit_capabilities, shared by ping and ping6. The relevant chunk of code looks like this: if (prctl(PR_SET_KEEPCAPS, 1) < 0) { ...


3

You cannot change permissions explicitly on extraction, but you can put the preferred identities into the tarball on creation (even when not running as root). tar cvf /tmp/tarball.tar --user=naftuli --group=othergroup files... If the source system doesn't know your account details you can suffix the names with the preferred uid and gid (e.g. ...


3

The uid of the second process has been reset already because there is no need to be root anymore after the sockets have been opened. The passwd utility still needs root privileges when you checked. If you like to verify this, you will need to check the source-code as the reset of the uid may be done too fast to give others a chance to verify the uid before ...


2

Based on the clarification, I'm quite certain you use the words user and process incorrectly. It looks to me that you believe something is either a user, or a process (exactly one of them). This is absolutely not the case. Every running instance of an executable program code (no matter if it's started "automatically" (e.g. as part of the boot process) or ...


2

If you run a similar command to yours: $ cut -d: -f1,6,7 /etc/passwd root:/root:/bin/bash bin:/bin:/sbin/nologin daemon:/sbin:/sbin/nologin adm:/var/adm:/sbin/nologin lp:/var/spool/lpd:/sbin/nologin sync:/sbin:/bin/sync shutdown:/sbin:/sbin/shutdown halt:/sbin:/sbin/halt mail:/var/spool/mail:/sbin/nologin operator:/root:/sbin/nologin ...


1

Any existing tarballs can be sanitized via something like: #!/usr/bin/env perl use strict; use warnings; use Archive::Tar 1.80; for my $tarfile (@ARGV) { my $tar = Archive::Tar->new($tarfile) // die "failed to read '$tarfile'\n"; for my $archivefile ($tar->list_files) { $tar->chown($archivefile, 'root:root'); } my ...


1

Generally .tar.gz is a usable file distribution format. GNU tar allows you to replace owner, group and permissions with other values when adding files to the archive. $ tar -c -f archive.tar --owner=0 --group=0 . https://www.gnu.org/software/tar/manual/html_section/tar_33.html#SEC69 If your version of tar does not support the GNU options you can copy ...


1

With GNU you can use --numeric-owner to prevent tar from storing your username. Alternatively, you can set another username with --owner=NAME. But you'll always get a user id in there. When it's extracted, those user ids will be dropped, unless the extractor is the root user. A common way used to bundle files is cpio which is typically used with the ...


1

Your database contents, customized scripts, and configurations should be your top priority. A full system backup is always a good idea to make sure you're not forgetting any important stuff, or to do a quick recovery.


1

Processes are running instances of executable binaries. Each process, similarly to each file etc., belongs to a certain user. (It's a bit more complicated because there are various user IDs for a process, but most of the time they are the same.) A terminal line (tty) can be opened by any process at any time, just as a process can open/create a file, a TCP ...


1

Any program can allocate a pseudo-terminal, it doesn't have to involve a login. It's just another form of inter-process communication, which is useful if the application needs to emulate a terminal. An example is the Expect program. It allocates a pseudo-terminal when it spawns a program, so that the program will act as if it's being run interactively by a ...


1

Where we would get, if every new user would be able to sudo by default? This is administrator privilege. Ubuntu is using group sudo to give users this privilege. If you want to allow user to run sudo for everything, add him to the sudo group: useradd -G sudo user1 If you want to limit the user more, you should check how sudoers file look like and adjust ...



Only top voted, non community-wiki answers of a minimum length are eligible