Sponsored Content
Top Forums Shell Programming and Scripting problem with changing default home directory Post 302239408 by fimblo on Tuesday 23rd of September 2008 02:51:08 PM
Old 09-23-2008
On modern Solaris (10) and many linuces you can use the command usermod, quite useful.

usermod -d /path/to/new/home target_username

/fimblo
 

9 More Discussions You Might Find Interesting

1. Solaris

home directory problem

I have solaris 9 installed across 2 disks. disk 1 / s0 swap s1 /usr s6 /var s3 /home s7 disk2 /swapfile (spare space for use with swap) s1 /opt s5 /export/home s7 When I create a new user using solaris Management... (1 Reply)
Discussion started by: finster
1 Replies

2. UNIX for Dummies Questions & Answers

user home directory problem

The home directory for me on my system is on /home/kwon. It was created using "useradd kwon" When i go to change the home directory for a user doing a usermod -d /home/test when they log on it gives them messages saying to generate new ssh keys, and it does. It gives me a thing that says... (1 Reply)
Discussion started by: BangYourWallnut
1 Replies

3. UNIX for Dummies Questions & Answers

Can I prevent a user from changing the permissions on their home directory.

Hello All, I have a new HPUX system going into production and it will be used by 2 projects. One of the contract requirements is the 2 groups can not have access to the others work or data. I believe I have the system pretty well locked up using groups and permissions and selective mounting of... (2 Replies)
Discussion started by: DanL
2 Replies

4. Shell Programming and Scripting

Problem with changing directory and subdirectories to read only

I have a directory with its subdirectories and files. I want to change them all to read only. Say it is ~/test chmod -R 444 ~/test chmod: `/home/myname/test': permission denied I do not understand. Do I have to have executable mode for a diirectory to access. How can I change ~/test to... (5 Replies)
Discussion started by: lalelle
5 Replies

5. UNIX for Advanced & Expert Users

Problem: Automounting Home directory for nis & nfs configuration doesn't work

Hi all, First of all, i am so sorry about my bad level in English writing. I have some problem in linux and i hope the experts of this forum to help me if they have enough time to reply to me. I have a scenario of configuring NIS and NFS in Redhat Linux environment such that user can login... (0 Replies)
Discussion started by: pioneer
0 Replies

6. Shell Programming and Scripting

Changing home directory

Hello All: I have an LDAP server that is used for authentication. Now the home directory id set to : /export/home/user1 . But I am logging in to different machines Solaris, Linux. The problem is I want the home directory to change depending on the os version (e.g. /export/home/user1/linux). Can... (1 Reply)
Discussion started by: disturbe_d
1 Replies

7. HP-UX

Changing the default login directory of a user

I want to change the default login directory of a user from /home/user to a new directory. how can i do this? thanks in advance....:) (1 Reply)
Discussion started by: smahe23
1 Replies

8. Solaris

User's Home directory ownership is changing Automatically

Hi , on my Solaris 10 machine user's home directory ownership is being changed automatically to their UID. can any one please tell me whats the reason behind it . users are there in /etc/passwd file . /etc/shadow file is also there along with nssswitch.conf file and there is no changes made to... (5 Replies)
Discussion started by: usernew
5 Replies

9. Solaris

SunOS confusing root directory and user home directory

Hello, I've just started using a Solaris machine with SunOS 5.10. After the machine is turned on, I open a Console window and at the prompt, if I execute a pwd command, it tells me I'm at my home directory (someone configured "myuser" as default user after init). ... (2 Replies)
Discussion started by: egyassun
2 Replies
USERMOD(8)						    BSD System Manager's Manual 						USERMOD(8)

NAME
usermod -- modify user login information SYNOPSIS
usermod [-FmoSv] [-C yes/no] [-c comment] [-d home-dir] [-e expiry-time] [-f inactive-time] [-G secondary-group] [-g gid | name | =uid] [-L login-class] [-l new-login] [-p password] [-s shell] [-u uid] user DESCRIPTION
The usermod utility modifies user login information on the system. Default values are taken from the information provided in the /etc/usermgmt.conf file, which, if running as root, is created using the built- in defaults if it does not exist. See user(8) for more information about EXTENSIONS. After setting any defaults, and then reading values from /etc/usermgmt.conf, the following command line options are processed: -C yes/no Enable user accounts to be temporary locked/closed. The yes/no operand can be given as ``yes'' to lock the account or ``no'' to unlock the account. -c comment Set the comment field (also, for historical reasons known as the GECOS field) for the user. The comment field will typically include the user's full name and, perhaps, contact information for the user. -d home-directory Set the home directory without populating it; if the -m option is specified, tries to move the old home directory to home-directory. -e expiry-time Set the time at which the account expires. This can be used to implement password aging. It should be entered in the form ``month day year'', where month is the month name (the first three characters are sufficient), day is the day of the month, and year is the year. Time in seconds since the epoch (UTC) is also valid. A value of 0 can be used to disable this feature. This value can be preset for all users using the expire field in the /etc/usermgmt.conf file. See usermgmt.conf(5) for more details. -F Force the user to change their password upon next login. -f inactive-time Set the time at which the password expires. See the -e option. -G secondary-group Specify a secondary group to which the user will be added in the /etc/group file. The secondary-group may be a comma-delimited list for multiple groups. Or the option may be repeated for multiple groups. (16 groups maximum.) -g gid | name | =uid Give the group name or identifier to be used for the user's primary group. If this is '=uid', then a uid and gid will be picked which are both unique and the same, and a line will be added to /etc/group to describe the new group. This value can be preset for all users by using the group field in the /etc/usermgmt.conf file. See usermgmt.conf(5) for more details. -L login-class Set the login class for the user. See login.conf(5) for more information on user login classes. This value can be preset for all users by using the class field in the /etc/usermgmt.conf file. See usermgmt.conf(5) for more details. This option is included if built with EXTENSIONS. -l new-user Give the new user name. It can consist of alphanumeric characters and the characters '.', '-', and '_'. -m Move the home directory from its old position to the new one. If -d is not specified, the new-user argument of the -l option is used; one of -d and -l is needed. -o Allow duplicate uids to be given. -p password Specify an already-encrypted password for the user. This password can then be changed by using the chpass(1) utility. This value can be preset for all users by using the password field in the /etc/usermgmt.conf file. See usermgmt.conf(5) for more details. This option is included if built with EXTENSIONS. -S Allow samba user names with a trailing dollar sign to be modified. This option is included if built with EXTENSIONS. -s shell Specify the login shell for the user. This value can be preset for all users by using the shell field in the /etc/usermgmt.conf file. See usermgmt.conf(5) for more details. -u uid Specify a new uid for the user. Boundaries for this value can be preset for all users by using the range field in the /etc/usermgmt.conf file. See usermgmt.conf(5) for more details. -v Enable verbose mode - explain the commands as they are executed. This option is included if built with EXTENSIONS. Once the information has been verified, usermod uses pwd_mkdb(8) to update the user database. This is run in the background. At very large sites this can take several minutes. Until this update is completed, the password file is unavailable for other updates and the new informa- tion is not available to programs. EXIT STATUS
The usermod utility exits 0 on success, and >0 if an error occurs. FILES
/etc/usermgmt.conf SEE ALSO
chpass(1), group(5), passwd(5), usermgmt.conf(5), pwd_mkdb(8), user(8), useradd(8), userdel(8) HISTORY
The usermod utility first appeared in NetBSD 1.5. It is based on the addnerd package by the same author. AUTHORS
The usermod utility was written by Alistair G. Crooks <agc@NetBSD.org>. BSD
January 13, 2009 BSD
All times are GMT -4. The time now is 05:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy