1

I created a new user in RHEL7

useradd newuser

When I opened the ~/.bash_profile of this user, the output is

 $cat -n ~/.bash_profile
 1  # .bash_profile
 2
 3  # Get the aliases and functions
 4  if [ -f ~/.bashrc ]; then
 5      . ~/.bashrc
 6   fi
 7    
 8  # User specific environment and startup programs
 9    
 10  PATH=$PATH:$HOME/.local/bin:$HOME/bin
 11
 12  export PATH
 $

From where this bash_profile is inherited to the newly added user? If I need to removing appending of $PATH for the every new user created using useradd. How can I do that ?

anoop.babu
  • 405
  • 2
  • 6
  • 13

1 Answers1

1

From /etc/skel (or SKEL_DIR from -k) as explained in the man page for the -m/--create-home option most likely.

If you don't want that then don't have useradd create the home directory and/or just delete the file after the user is created.

Etan Reisner
  • 77,877
  • 8
  • 106
  • 148
  • But I need the home directory created for every user. Skeleton directory looks fine. Thanks :-) – anoop.babu Jan 29 '15 at 16:51
  • You can create the directory yourself without needing `useradd` to do it for you but you can also just control the skeleton directory if that suits your purpose better. – Etan Reisner Jan 29 '15 at 16:52