Sponsored Content
Full Discussion: unable to set user home dir
Top Forums UNIX for Dummies Questions & Answers unable to set user home dir Post 302310974 by some_one on Monday 27th of April 2009 01:51:33 PM
Old 04-27-2009
OS: Solaris 9

commands:
Code:
useradd <username>
usermod -d <path> <username>

relevant output of passwd:
Code:
 
username:x:555:444::/export/home/mydir/:/usr/bin/rksh

ls -l /export/home
Code:
 
drw-------   2 username   other        512 Apr 27 10:57 mydir

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Modify user home dir

I created a new user and assigned a certain home dir to tis user. I've noticed that this home dir (/export/home/test) is already assigned to other users. I really want to create a dedicated home dir for the new user. Can anyone tell me how I can modify this user with a new homedir? Thx for... (4 Replies)
Discussion started by: kris_devis
4 Replies

2. UNIX for Dummies Questions & Answers

listing home dir of anothe user

Hi I am trying to display the home directory of another user. I dont have the permissions to change into their directory and wonder is it possible to display their directory eg I cant change directory to john but I am trying to display something like /home/John. If anyone can help I would... (3 Replies)
Discussion started by: mmg2711
3 Replies

3. Solaris

need to restrict user to his home dir

Hello, i need to create a user who's access is restricted only to his home directory and below, i restricted his pty access by adding 'no-pty' to the options of the ssh key in authorized_keys file. However, sftp access still allows this user access to all my file system thanks (5 Replies)
Discussion started by: lidram
5 Replies

4. UNIX for Dummies Questions & Answers

Restrict user access to their home dir

Hi! i'm using FreeBSD 6.2 and hosting my pc to frens in particular of sensitive information being saved to the PC, i would like to know is it possible for me to restrict user access to their /home dir. only? and also, i wanted to restrict them listing files under /etc thanks all! (10 Replies)
Discussion started by: rdns
10 Replies

5. AIX

Not able to mount user home dir from with automount

Hello there Have anyone configured an AIX 5L machine as NIS client? with homedirectories automounted form an NFS share? The NIS server is running Solaris. I am able to configure the AIX machine as client and user is able to login but I have configured the client to use the automountd... (0 Replies)
Discussion started by: balaji_prk
0 Replies

6. Solaris

how to change /export/home/user dir to /home /user in solaris

Hi all i am using solaris 10, i am creating user with useradd -d/home/user -m -s /bin/sh user user is created with in the following path /export/home/user (auto mount) i need the user to be created like this (/home as default home directory ) useradd -d /home/user -m -s /bin/sh... (2 Replies)
Discussion started by: kalyankalyan
2 Replies

7. HP-UX

Unable to Set Prompt to current working DIR

HPUX does not recognise \h,\w,\u to display the hostname,working directory and username respectively. So how do i set the PS1 variable to display my current working Directory as my prompt? I also tried PS1=$PWD, But it keeps showing the same directory path as prompt which PWD was holding at... (3 Replies)
Discussion started by: Amit Kulkarni
3 Replies

8. Solaris

remove a user without removing its home dir

HI all, I have wrongly given a wrong home directory to a user. This dir is very critical for my production environment(Can;t afford to lose it for a single minute) Now i want to delete that user, Whenever i try to delete user it tries to delete its home dir. Commnd i use: userdel ... (9 Replies)
Discussion started by: varunksharma87
9 Replies

9. HP-UX

[Solved] Unable to change/create home dir for particular user

Hi all I wanted to change the home dir for a user, but when using smh : SMH->Accounts for Users and Groups->Local Users->Modify User ---------------------------------------------------------------------------------------------------------------------------------------------- * Required... (8 Replies)
Discussion started by: fretagi
8 Replies

10. UNIX for Dummies Questions & Answers

Switching from root to normal user takes me to user's home dir

Whenever i switch from root to another user, by doing su - user, it takes me to home directory of user. This is very annoying as i want to be in same dir to run different commands as root sometimes and sometimes as normal user. How to fix this? (1 Reply)
Discussion started by: syncmaster
1 Replies
USERDEL(8)						    System Management Commands							USERDEL(8)

NAME
userdel - delete a user account and related files SYNOPSIS
userdel [options] LOGIN DESCRIPTION
userdel is a low level utility for removing users. On Debian, administrators should usually use deluser(8) instead. The userdel command modifies the system account files, deleting all entries that refer to the user name LOGIN. The named user must exist. OPTIONS
The options which apply to the userdel command are: -f, --force This option forces the removal of the user account, even if the user is still logged in. It also forces userdel to remove the user's home directory and mail spool, even if another user uses the same home directory or if the mail spool is not owned by the specified user. If USERGROUPS_ENAB is defined to yes in /etc/login.defs and if a group exists with the same name as the deleted user, then this group will be removed, even if it is still the primary group of another user. Note: This option is dangerous and may leave your system in an inconsistent state. -h, --help Display help message and exit. -r, --remove Files in the user's home directory will be removed along with the home directory itself and the user's mail spool. Files located in other file systems will have to be searched for and deleted manually. The mail spool is defined by the MAIL_DIR variable in the login.defs file. -R, --root CHROOT_DIR Apply changes in the CHROOT_DIR directory and use the configuration files from the CHROOT_DIR directory. -Z, --selinux-user Remove any SELinux user mapping for the user's login. CONFIGURATION
The following configuration variables in /etc/login.defs change the behavior of this tool: MAIL_DIR (string) The mail spool directory. This is needed to manipulate the mailbox when its corresponding user account is modified or deleted. If not specified, a compile-time default is used. MAIL_FILE (string) Defines the location of the users mail spool files relatively to their home directory. The MAIL_DIR and MAIL_FILE variables are used by useradd, usermod, and userdel to create, move, or delete the user's mail spool. 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. USERDEL_CMD (string) If defined, this command is run when removing a user. It should remove any at/cron/print jobs etc. owned by the user to be removed (passed as the first argument). The return code of the script is not taken into account. Here is an example script, which removes the user's cron, at and print jobs: #! /bin/sh # Check for the required argument. if [ $# != 1 ]; then echo "Usage: $0 username" exit 1 fi # Remove cron jobs. crontab -r -u $1 # Remove at jobs. # Note that it will remove any jobs owned by the same UID, # even if it was shared by a different username. AT_SPOOL_DIR=/var/spool/cron/atjobs find $AT_SPOOL_DIR -name "[^.]*" -type f -user $1 -delete ; # Remove print jobs. lprm $1 # All done. exit 0 USERGROUPS_ENAB (boolean) If set to yes, userdel will remove the user's group if it contains no more members, and useradd will create by default a group with the name of the user. FILES
/etc/group Group account information. /etc/login.defs Shadow password suite configuration. /etc/passwd User account information. /etc/shadow Secure user account information. EXIT VALUES
The userdel command exits with the following values: 0 success 1 can't update password file 2 invalid command syntax 6 specified user doesn't exist 8 user currently logged in 10 can't update group file 12 can't remove home directory CAVEATS
userdel will not allow you to remove an account if there are running processes which belong to this account. In that case, you may have to kill those processes or lock the user's password or account and remove the account later. The -f option can force the deletion of this account. You should manually check all file systems to ensure that no files remain owned by this user. You may not remove any NIS attributes on a NIS client. This must be performed on the NIS server. If USERGROUPS_ENAB is defined to yes in /etc/login.defs, userdel will delete the group with the same name as the user. To avoid inconsistencies in the passwd and group databases, userdel will check that this group is not used as a primary group for another user, and will just warn without deleting the group otherwise. The -f option can force the deletion of this group. SEE ALSO
chfn(1), chsh(1), passwd(1), login.defs(5), gpasswd(8), groupadd(8), groupdel(8), groupmod(8), useradd(8), usermod(8). shadow-utils 4.1.5.1 05/25/2012 USERDEL(8)
All times are GMT -4. The time now is 07:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy