Tag Info

Hot answers tagged

6

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


3

nothing is guaranteed. root - is usually on linux/unix systems, but - i saw systems where uid=0 was used by "admin". Usually - there are users like root, nobody, daemon, bin, sys. www-data is on debian/ubuntu, but for example on redhat/centos/fedora/pld there is apache user instead. Recomendations/fixed uids for users other than root are only within ...


2

You could replace $USER with $(whoami) (a command that is built in on almost all Unix systems). As for why $USER isn't set, it's typically set by login. But since you're SSH'ing into the server instead of using an actual interactive shell, the $USER variable is (and several other environment variables are) never set.


1

Would the correct approach here be to change the "owner" of the files from what I assume is root to my FTP user? Yes. As root, run chown -R yourftpuser:yourftpgroup /path/to/tree. Your permissions will be fine for FTP at that point. All files will be owned by the FTP user, who has write access┬╣. In future, you can avoid this by cloning as the user you ...


1

useradd -m LOGIN creates the user's home directory


1

The useradd program has been deprecated in favor of adduser. From man useradd: useradd is a low level utility for adding users. On Debian, administrators should usually use adduser(8) instead. adduser is a friendlier frontend to useradd and will do things like create user directories by default. When you run it with only a username as an argument, ...


1

You could simply cat the /etc/passwd file or use, awk -F':' '{ print $1}' /etc/passwd To cut the first field of the same file, it'd list the names you're expecting. Additonally, w who and finger would help you with who all are logged in from which locations/tty and their activity details.



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