Sponsored Content
Full Discussion: Creating files with New User
Top Forums UNIX for Dummies Questions & Answers Creating files with New User Post 302780347 by mrm5102 on Thursday 14th of March 2013 12:08:44 PM
Old 03-14-2013
Creating files with New User

Hello All,

I just created a new user on a server running SLES 11, and I created the user using the command below:
Code:
# useradd -G nagios scpuser

But whenever I create a file or directory while logged in as this user it creates the file's ownership permissions as "scpuser:users"
instead of it using the name of the group I added it to when I created it...

Any idea how I can get it to create files/dirs with the user:group combo I used when I created the User...? I'm guessing when
this user creates files/dirs and it gives the group ownership as "users", I'm guess this is some sort of default behavior?

Anyway, basically I just want this user to create files/dirs and have the ownership/permissions be set
using User=scpuser and Group=nagios...
Any idea how I make this the default behavior for this user?

I verified that the scpuser is ONLY listed on one line, and that is with the 'nagios' group in /etc/group file.


Any thoughts would be much appreciated!

Thanks in Advance,
Matt
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

creating a new user

i just installed netBSD, and i want to know how to create a new user account. i understand that netBSD doesn't come with the tools to do that, so i downloaded a user utility (mebbe i'm wrong about netBSD) but the problem is, i don't know how to read files off floppy disks. (i'm quite new to unix)... (3 Replies)
Discussion started by: Newbie4ever
3 Replies

2. UNIX for Advanced & Expert Users

creating user accounts in AIX

Hello all: I am new to UNIX and I am given the responsibility of administering a UNIX machine recently. The system is a IBM AIX 3.1. As a part of my duties I recently created some user accounts using "smit". It looked as if everything went well. But, after creating the account, I logged into... (3 Replies)
Discussion started by: pdepa
3 Replies

3. UNIX for Dummies Questions & Answers

creating a new user

I have AIX 5.1 I have created a user manually in the /etc directory. Then I created his home directory "mkdir /home/fharvey" then I changed ownership "chown fharvey /home/fharvey" set his password "passwd fharvey" When I log in as him I get "user is required to change password. "when I... (7 Replies)
Discussion started by: rocker40
7 Replies

4. AIX

Limiting length of user in while creating user

Hi all, I am a newbe to aix 5.2. I want to specify the characters used by users while creating user in aix like specifying the length of the password should i use some sript for that if it is then please let me know how to do this if yes give me the link for the scripts. Thanks in advance ... (2 Replies)
Discussion started by: Satya Mishra
2 Replies

5. UNIX for Dummies Questions & Answers

Creating user accounts

Hey everyone I am new to the forums and to Unix. I am currently taking a class on Unix, our teacher posed the question to us How do u create a user account without using GUI or command? We are currently running Knoppix version of Unix and for the life of me I can't figure out how this is possible.... (0 Replies)
Discussion started by: Redditt90kg
0 Replies

6. Shell Programming and Scripting

Creating user accounts

Hi, I have written a program using shell scripting. When you run the file it will asks you to enter the user name, if the user exists it says " user exists " if not it will displays like " user doesnt exist" and then asks you like " do you want to add user with options Yes or No " if you say... (1 Reply)
Discussion started by: vishwaprasad
1 Replies

7. Solaris

Creating user in solaris

Hi all, I logged in as root in solaris machine and made an attempt to create a user ,i am getting the following error message pls help me to resolve this issue bash-3.00# useradd -d /home/kalyan -m -s /bin/sh kalyan UX: useradd: ERROR: Unable to create the home directory: Operation not... (2 Replies)
Discussion started by: kalyankalyan
2 Replies

8. Ubuntu

Ubuntu creating a new user with Desktop

Hi, I am using Ubuntu 8.04 32-bit x86 m/c. I am using the following command to create an user. useradd -d /home/new_user -m new_user -s /bin/bash But, I am not get to see the "Desktop" directory automatically created. May I know how to create it by default? (1 Reply)
Discussion started by: royalibrahim
1 Replies

9. Linux

Default user:group permissions while creating files and directories

Hi, I am working on setup a environment where only a specific user can upload the builds on htdocs of apache. Now i want that a specific user can copy the builds on htdocs folder. I created a group "deploy" and assign user1 and user2 to this group. On Apache side i mentioned User=deploy... (3 Replies)
Discussion started by: sunnysthakur
3 Replies

10. UNIX for Advanced & Expert Users

Prevent user from creating new user from his login

Hi Experts, Need your support Redhat 6.5 I want to create a user with all(read, write, execute) privileges except that user should not be able to create any new user from his login to perform any task. (10 Replies)
Discussion started by: as7951
10 Replies
NEWUSERS(8)						    System Management Commands						       NEWUSERS(8)

NAME
newusers - update and create new users in batch SYNOPSIS
newusers [options new_users] DESCRIPTION
The newusers command reads a file of user name and clear-text password pairs and uses this information to update a group of existing users or to create new users. Each line is in the same format as the standard password file (see passwd(5)) with the exceptions explained below: pw_name:pw_passwd:pw_uid:pw_gid:pw_gecos:pw_dir:pw_shell pw_name This is the name of the user. It can be the name of a new user or the name of an existing user (or an user created before by newusers). In case of an existing user, the user's information will be changed, otherwise a new user will be created. pw_passwd This field will be encrypted and used as the new value of the encrypted password. pw_uid This field is used to define the UID of the user. If the field is empty, an new (unused) UID will be defined automatically by newusers. If this field contains a number, this number will be used as the UID. If this field contains the name of an existing user (or the name of an user created before by newusers), the UID of the specified user will be used. If the UID of an existing user is changed, the files ownership of the user's file should be fixed manually. pw_gid This field is used to define the primary group ID for the user. If this field contains the name of an existing group (or a group created before by newusers), the GID of this group will be used as the primary group ID for the user. If this field is a number, this number will be used as the primary group ID of the user. If no groups exist with this GID, a new group will be created with this GID, and the name of the user. If this field is empty, a new group will be created with the name of the user and a GID will be automatically defined by newusers to be used as the primary group ID for the user and as the GID for the new group. If this field contains the name of a group which does not exist (and was not created earlier wbefore by newusers), a new group will be created with the specified name and a GID will be automatically defined by newusers to be used as the primary group ID for the user and Gs the ID for the new group. pw_gecos This field is copied in the GECOS field of the user. pw_dir This field is used to define the home directory of the user. If this field does not specify an existing directory, the specified directory is created, with ownership set to the user being created or updated and its primary group. If the home directory of an existing user is changed, newusers does not move or copy the content of the old directory to the new location. This should be done manually. pw_shell This field defines the shell of the user. No checks are performed on this field. newusers first tries to create or change all the specified users, and then write these changes to the user or group databases. If an error occurs (except in the final writes to the databases), no changes are committed to the databases. During this first pass, users are created with a locked password (and passwords are not changed for the users which are not created). A second pass is used to update the passwords using PAM. Failures to update a password are reported, but will not stop the other password updates. This command is intended to be used in a large system environment where many accounts are updated at a single time. OPTIONS
The options which apply to the newusers command are: -h, --help Display help message and exit. -r, --system Create a system account. System users will be created with no aging information in /etc/shadow, and their numeric identifiers are chosen in the SYS_UID_MIN-SYS_UID_MAX range, defined in login.defs, instead of UID_MIN-UID_MAX (and their GID counterparts for the creation of groups). CAVEATS
The input file must be protected since it contains unencrypted passwords. CONFIGURATION
The following configuration variables in /etc/login.defs change the behavior of this tool: GID_MAX (number), GID_MIN (number) Range of group IDs used for the creation of regular groups by useradd, groupadd, or newusers. MAX_MEMBERS_PER_GROUP (number) Maximum members per group entry. When the maximum is reached, a new group entry (line) is started in /etc/group (with the same name, same password, and same GID). The default value is 0, meaning that there are no limits in the number of members in a group. This feature (split group) permits to limit the length of lines in the group file. This is useful to make sure that lines for NIS groups are not larger than 1024 characters. If you need to enforce such limit, you can use 25. Note: split groups may not be supported by all tools (even in the Shadow toolsuite). You should not use this variable unless you really need it. PASS_MAX_DAYS (number) The maximum number of days a password may be used. If the password is older than this, a password change will be forced. If not specified, -1 will be assumed (which disables the restriction). PASS_MIN_DAYS (number) The minimum number of days allowed between password changes. Any password changes attempted sooner than this will be rejected. If not specified, -1 will be assumed (which disables the restriction). PASS_WARN_AGE (number) The number of days warning given before a password expires. A zero means warning is given only upon the day of expiration, a negative value means no warning is given. If not specified, no warning will be provided. SYS_GID_MAX (number), SYS_GID_MIN (number) Range of group IDs used for the creation of system groups by useradd, groupadd, or newusers. SYS_UID_MAX (number), SYS_UID_MIN (number) Range of user IDs used for the creation of system users by useradd or newusers. UID_MAX (number), UID_MIN (number) Range of user IDs used for the creation of regular users by useradd or newusers. UMASK (number) The file mode creation mask is initialized to this value. If not specified, the mask will be initialized to 022. useradd and newusers use this mask to set the mode of the home directory they create It is also used by pam_umask as the default umask value. FILES
/etc/passwd User account information. /etc/shadow Secure user account information. /etc/group Group account information. /etc/gshadow Secure group account information. /etc/login.defs Shadow password suite configuration. /etc/pam.d/newusers PAM configuration for newusers. SEE ALSO
login.defs(5), passwd(1), useradd(8). System Management Commands 06/24/2011 NEWUSERS(8)
All times are GMT -4. The time now is 08:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy