Tag Info

Hot answers tagged

25

First off, the respective man page snippets highlight the differences between the two commands and give some indication of what is going on. For adduser: adduser and addgroup add users and groups to the system according to command line options and configuration information in /etc/adduser.conf. They are friendlier front ends to the low level ...


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


4

In my opinion, you need to recommend to your client to change their policy. As Ulrich Schwarz said in a comment, it's kind of surprising that all-numeric usernames work at all. Consider this: if a user called 12345 exists in the system, how would you use the chown command to change a file's uid to the numeric value 12345? Hint: it's actually possible, but ...


4

adduser is there for compatibility with older versions of RHEL, and with other OSes. For purely command-line operation, useradd is the preferred method. system-config-users doesn't fit in the same category as the other two. It is a GUI program. It's implemented in terms of userhelper, which has a command line I/O interface more suitable for use as the ...


4

When you're using /etc/passwd and /etc/shadow for user accounts (as set in /etc/nsswitch.conf and PAM), then entry in those two files are fully sufficient to create the account. (/etc/group may be needed too, for their groups). All useradd does is edit those files. If you edit them yourself with vipw & vigr and add the user, you've created the account. ...


3

The umask 022 (or 0022) is the commonly used umask for UNIX systems which use the traditional style of user account management. In the traditional style of account management, when a user is created, the user is given a default group which would be something like a team or department, or maybe as simple as "users". setgid directories (we could call them ...


2

The documented way to create the mysql account is: groupadd mysql useradd -r -g mysql mysql Add the -m option if you want that account to be used as a login account, which looks to be the case. If you have full sudo access, you can grant sudo rights to that use with using sudo visudo and adding a line similar the one starting with your username and ...


2

It looks like your shell is not being bash but plain sh. Super quick solution: just execute bash and see if that helps. For a better and permanent solution please check /etc/passwd and see what shell does the user have there. If you find /bin/sh change it for /bin/bash


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

The problem is indeed what @LuisAntolin pointed out. On Ubuntu systems, and most others, the default shell is /bin/sh. This is a symlink to /bin/dash on Debian-based systems. dash has no history command which is why you're getting that error. While you can indeed change this by editing /etc/password, a better way is to run chsh as the user ubuntu and set ...


1

I don't know what you mean by "next available" with respect to the $HOME and $SHELL variables. Those you just set to their defaults: /home/USERNAME and /bin/bash or whatever. For the $HOME, just make sure the directory does not exist ([ -e "/home/$username" ] && echo "Directory exists"). As for the groups, just list the available groups and take ...


1

If you delete the user account, then the user no longer exists. It's perfectly normal that the user ID then gets reused: there is nothing to distinguish this user ID from any other unused user ID. If the account still owns files, the account still exists, so you need to keep it around. Don't delete the entry in the user database, mark it as disabled. On ...


1

You can use awk to filter out new users from /var/log/secure as follows:- awk '/new\ user/ {gsub(/,|name=/,"",$8); print $1, $2, $3, $8}' /var/log/secure Note: Debian systems (I believe) use /var/log/auth.log instead.


1

I'm not familiar with ATT SVR4 — it was old before my time. But from your description, I think I can provide enough guidance to solve your problem. Unix doesn't exactly have a notion of “administrator user”. That's a Windows name that doesn't map directly to a Unix concept. Under Unix, the only administrator account is root, user ID 0. Accounts that belong ...


1

After adding new user if you are loggedin as a 'root' then you can set the password using command passwd <username> Or, if you are not root, you can run sudo passwd <username> To set the password. Or if you are root then you can 'su' to the user and run 'passwd' to set the password. su <username> passwd


1

As @Mikel suggests, if you are trying to configure a system account which is a daemon, try configuring the daemon itself. I came to this question looking how to set the umask for the _www account on MacOS. While this is difficult as the answers above suggest, I found I could solve it by configuring the apache service as (in this case) the user == a daemon. ...



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