Tag Info

Hot answers tagged

16

TL;DR find / ! -type l -print0 | sudo -u "$user" perl -Mfiletest=access -l -0ne 'print if -w' You need to ask the system if the user has write permission. The only reliable way is to switch the effective uid, effective gid and supplementation gids to that of the user and use the access(W_OK) system call (even that has some limitations on some ...


7

You submit a support call to IBM who then give you the hscpe user password, which is good for one day. That user ID and password allows you to gain access to root (assuming you recorded the root password when you installed the HMC). Then you can cat /etc/shadow. You can't do it without root access (by design), and you can't simply switch to root either ...


7

With write: write <user> Some text goes here CTRL-D (eof) Alternative: echo "Some text goes here" | write <user> See man write.


3

You can combine options with the find command, so it will find out the files with specified mode and owner. For instance: $ find / \( -group staff -o -group users \) -and -perm -g+w The above command will list all entries which belong to the group "staff" or "users" and have write permission for that group. You should also check for entries which are ...


3

you can use killall to kill, or send any other signal, to a bunch of processes at once. One of the "filtering" options is the owner: killall --user name1 I don't like killall (using it on solaris can cause disaster). pkill is more portable pkill -u username


3

You cannot do that on the usual Linux filesystems, as it doesn't keep track of the creator of the file, only of the owner of the file. The creator and owner are usually, but not necessarily the same. If you want to find the owner of the file, you can, as Bratchley indicated, use find / -type f -user user_name to find those files and display the names. ...


2

A HMC is a blackbox solution from IBM. You aren't supposed to have root access. It is possible to request a tempoary password from IBM that provide root access.


2

Perhaps like this: #! /bin/bash writable() { local uid="$1" local gids="$2" local ids local perms ids=($( stat -L -c '%u %g %a' -- "$3" )) perms="0${ids[2]}" if [[ ${ids[0]} -eq $uid ]]; then return $(( ( perms & 0200 ) == 0 )) elif [[ $gids =~ (^|[[:space:]])"${ids[1]}"($|[[:space:]]) ]]; then return ...


2

One way of thinking of users are actual accounts which a person could log into on your server. But a more common view of users, which you should get used to for administration, is more like a system role. For example, if you install apache, you will see apache running as 'http' or 'apache' user. That is a legit user on your system, but noone could login ...


1

Technically this question doesn't make sense. What you want to do is offer people the possibility to connect to your computer and load webpages. For doing that you have to install for example apache as a webserver to give access to the pages. For installing Apache you need to be logged in as a user with root privileges. This user could be the new user(only ...


1

The approach depends upon what you are really testing. Do you want to ensure write access is possible? Do you want to ensure lack of write access? This is because there are so many ways to arrive at 2) and St├ęphane's answer covers these well (immutable is one to remember), and recall that there are physical means as well, such as unmounting the drive or ...


1

As a comment says, you don't cat /etc/shadow unless you already have root permissions. That's how the system is designed - that's how UNIX and Linux system have been designed since at least the 1990's if not before (pre-1992 is before my time, so I can't speak with authority).


1

Depending on what files you want, you can create a new group (/etc/group) and make the file writable (and the directory containing it if you want the user to create new files) by that group (e.g., chgrp <groupname> <file>; chmod g+w <file>


1

usq psql shell and : \deu[+] [PATTERN] such as : postgres=# \deu+ List of user mappings Server | User name | FDW Options --------+-----------+------------- (0 rows) And for all users: postgres=# \du List of roles Role name | Attributes | Member of ...


1

There's no standard command to enumerate all existing user accounts. On most Unix variants, /etc/passwd contains the list of local accounts, always with the same traditional format (colon-separated columns). On Linux with Glibc (i.e. any non-embedded Linux), you can use the getent command: getent passwd is similar to cat /etc/passwd, but also includes remote ...



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