Tag Info

Hot answers tagged

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


16

There's no difference between an external drive and an internal drive in terms of the filesystem stored on it. The owner & group of the filesystem's root directory are stored in its root directory, the same way your root filesystem's owner & group are stored. A corollary of this is that because UIDs and GIDs are stored only numerically, if you ...


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


15

User accounts are used not only for actual, human users, but also to run system services and sometimes as owners of system files. This is done because the separation between human users' resources (processes, files, etc.) and the separation between system services' resources requires the same mechanisms under the hood. The programs that you run normally run ...


12

Since the release of 0.9 Docker has dropped LXC and uses its own execution environment, libcontainer. Your question's a bit old but I guess my answer still applies the version you are using. Quick Answer: To understand the permissions of volumes, you can take the analogy of mount --bind Host-Dir Container-Dir. So to fulfill your requirement you can use any ...


11

The major difference between sudo and su is the mechanism used to authenticate. With su the user must know the root password (which should be a closely guarded secret), while with sudo the user uses his/her own password. In order to stop all users causing mayhem, the priviliges discharged by the sudo command can, fortunately, be configured using the ...


9

The command that you must use for you is: id and for any other user: id username


8

I'm not sure how standard it is, but at least in Ubuntu systems sudo sets the following environment variables (among others - see the ENVIRONMENT section of the sudo manpage): SUDO_UID Set to the user ID of the user who invoked sudo SUDO_USER Set to the login of the user who invoked sudo for example, steeldriver@lap-t61p:~$ sudo sh -c ...


8

In Linux/Unix the user with user id 0 is such a super administrator. The user is usually called "root", but the magic is really behind the id and not the name. That user is especially not bound to local file access permissions and can read and write any file. That user also has the ability to change to any other user without needing a password.


8

I presume you're finding this list of users by checking /etc/passwd? This is totally normal - 'users' serve to carry a set of permissions, useful for locking down not just 'actual users' but also programs to certain areas of your system and tracking what they changed (same concept with groups). I've inserted one of my Raspberry Pi /etc/passwd files below ...


7

You basically have 2 options. Use the local authentication system of each machine, and push out credential changes to all of them. Use a centralized authentication server. 1. Synchronized local authentication There are multiple products which accomplish this easily. Puppet, Chef, Ansible, and Salt are a few of the more common ones. All these tools fall ...


7

Yes, it's normal. The root user can do anything (including, say, changing a user's password, logging in as them, and changing it back), so they aren't restricted by su (or sudo). That includes password prompts and any other restrictions. The PAM configuration can be set up to have su present certain prompts to the root user still, for example encryption ...


7

You can get a list of all users with getent passwd | cut -d':' -f1 This selects the first column (user name) of the system user database. In contrast to solutions parsing /etc/passwd, this will work regardless of the type of database used (traditional /etc/passwd, LDAP, etc). Note that this list includes system users as well (e.g. nobody, mail, etc.). ...


7

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


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


6

You can use namei -m /path/to/really/long/directory/with/file/in which will output all of the permissions in the path in a vertical list. or namei -l /path/to/really/long/directory/with/file/in to list all owners and the permissions


6

getent group somegroupname || groupadd somegroupname


6

There are two commands related to root privileges, SUDO and SU. With SUDO, you don't become another user (including root). SUDO has a pre-defined list of approved commands that it executes on your behalf (this addresses what I asked in the comment about how you give selected users selective privileges). Since you are not becoming root or another user, you ...


6

Use the who comand. It lists all logged-in users. It's not just SSH users, it will also list users on the console and directly-connected terminals (if you have any). For SSH users, it will show where they're connected from.


6

If you change the file owner using chown, the permissions for alice would be transferred to bob. So here's the flow: sudo mv ~bob/Documents ~bob/Documents.orig sudo mv ~alice/Documents/ ~bob/Documents sudo chown -PR bob ~bob/Documents Edit: In case you want to overwrite the group as well, use sudo chown -PR bob:bob ~bob/Documents Or: sudo chown -PR ...


6

You can read ~/.bash_history file in users folder if you are admin or have special permissions.


6

You can login as the user or simply su from root to the user and run the command history you can also search history quite easily history | grep "what ever" Finally you can use ctrl+r {whatever}


5

That's how sudo works. You trust the user and the user's actions are logged. If you want to enter the root password, then you want to use the su command as follows:- su -c yum install <package> Password: Once the command above finishes, you're returned to your normal user's prompt.


5

You can add the files you want to /etc/skel directory. $ sudo touch /etc/skel/test.txt $ sudo useradd -m test $ ls /home/test test.txt From man useradd: -k, --skel SKEL_DIR The skeleton directory, which contains files and directories to be copied in the user's home directory, when the home directory is created by ...


5

sudo usermod -c "Jecht Tyre" jecht You can change it with -c option. -c is for adding comment usermod -c "YOUR NAME" username


5

The possible way to add an user is more or less similar to what I had put in the question. I got this approach from here. To create a new account manually, follow these steps: Edit /etc/passwd with vipw and add a new line for the new account. Be careful with the syntax. Do not edit directly with an editor. vipw locks the file, so that other commands won't ...


5

Essentially, it's part of a strategy to mitigate some security concerns while allowing users a simple way to collaborate with less permission hassles. Linux systems have what's called a umask, which dictates file and directory permissions assigned on creation. By default, this umask is usually 022 which creates files with 644 permissions (owner read/write, ...


5

It means that the password is locked. Tools, such as usermod -L add a ! to the password to invalidate it. usermod -U removes the !. From man 5 shadow If the password field contains some string that is not a valid result of crypt(3), for instance ! or *, the user will not be able to use a unix password to log in (but the user may log in the system by ...


5

R Perrin has it right. But it is a far better thing to login to a system via ssh as a "normal user", and become root should the need arise. One of the recommended hardening activities for a *NIX box is to disallow remote root login.


5

Does your system use Pluggable Authentication Modules (PAM)? Most modern Linux or BSD use PAM. PAM allows you to hook into logins. There are a variety of PAM modules available which might meet your needs, or you can write your own in C. There is even a pam-python* binding which allows you to hook in Python code. Given that you want the daemon to be running ...



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