Tag Info

New answers tagged

-1

~$ sudo login Then it will prompt you for the sudo password (the currently logged in user's password). Also: make sure that the current user is in the sudoers file!


2

I thought it was doing the reverse lookup of folks with "home" directories in /etc/password. On OS X Open Directory is consulted instead of /etc/passwd.


18

I don't have an OSX system handy to check on but on all *nixes, ~foo is a shorthand for the home directory of user foo. For example, this command will move into my user's $HOME (cd ~ alone will move into your home directory): cd ~terdon So, ~ and Tab will expand to all possible user names. The list should be the same as the list of users in /etc/passwd. ...


0

In the case of gnome - please use the following as a support in getting where you want to be. Security Disable access to any command line https://help.gnome.org/admin/system-admin-guide/stable/lockdown-command-line.html.en Ensure that the installation works as wanted before activating this or ensure that one can log in as root with the right password. ...


0

If it's only specific commands they need administrative privileges to run you can use pam_cap.so to grant the user whichever capability they need and use setcap to enable that command to inherit the given capability if the user also has it. Be advised that this will be obliterated when the package the file/command is a part of gets update. So you'll need a ...


0

In the file /etc/sudoers add the line; myuserid ALL=(ALL) ALL Another good reason for this is in a GUI environment, if you want to copy or rename system files it is stinky to type the massive paths to get to some system files, where you could just simply rename or drag/drop in GUI if you have root privileges.


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 ...


0

You can do... find / ! -type d -exec tee -a {} + </dev/null ...for a list of all files to which the user cannot write as written to stderr in the form... "tee: cannot access %s\n", <pathname>" ...or similar. See the comments below for notes on the issues this approach might have, and the explanation below for why it might work. More sanely, ...


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


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 ...


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 ...


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 ...


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 ...


0

Here is another simple way. You can set the user account expired. This will prevent both password-based and ssh key-based logins for the account, but does not touch the password. To lock the account: # chage -E 0 username The user account 'username' will be locked out on the system. To re-enable the user account, do the following. To unlock the account: ...


0

You can add users to your Oracle Linux system using the useradd command as root. If you need to add a group as well, use the groupadd command. You can see extended help for both commands by typing man useradd and man groupadd at your terminal prompt. Here's an Article from Oracle explaining exactly how to manage users on Oracle Linux. An example: useradd ...


0

with hscroot you can do a: chhmcusr -u root -t passwd and thus you will now know (change) the root password, log in with root, cat the /etc/shadow. Then if needed, restore the old shadow file from backup, so the root pw will be unchanged, but you will still have a root terminal to cat. But I didn't tested this yet. Usually "PermitRootLogin no" is in ...


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 ...


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.


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>


0

Use find: find / -type f -user “<SHORTUSERNAME>" -print 2>/dev/null So, in your script: echo “Enter Username:”; while read -e;do find / -type f -user $REPLY -print 2>/dev/null;done


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. ...


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 ...


7

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


0

Something that I do and it works for my purposes is ls /home Granted, that doesn't really give you a list of users rather a list of user's home directories and past user's directories but any command you want to do on a user that doesn't exist terminal will tell you and could be a hint to remove the home file that doesn't have a user or move it!



Top 50 recent answers are included