When you make a user profile on an IBM i, it does not create /home/USERNAME by default. When you first SSH in you have to make that folder. Is there a way to have that folder created on the IFS when you make a user profile?
Asked
Active
Viewed 107 times
1 Answers
1
Two options:
- Build/buy a Create User Profile Exit Program and register it for the CRTUSRPRF command.
- Write your own command that wraps CRTUSRPRF and does what you want before invoking CRTUSRPRF.
Option 1 is the prefered method now-a-days and is guaranteed to be invoked anytime a user profile is created.
Option 2 is old school, and there are various ways it could be bypassed. Even if your home grown command is named CRTUSRPRF and is in a library higher than QSYS in the library list.

Charles
- 311
- 1
- 7
-
So ideally speaking, since I'm going to want to add some unix dot files and the like, I should write an exit program that calls a shell script via QSH that makes the folder, copies the dot files, and whatever? – Justin Dearing Oct 08 '15 at 13:26
-
Yes, the exit program is the best bet. You don't have to use a shell script to copy the files as the native CPY command works on IFS objects along with the native CRTDIR command to create the directory. – Charles Oct 08 '15 at 13:41
-
My thinking with the shell script, is I'm basically going to want to create the equivalent of the scripts that Linux/FreeBSD/etc run as part of their useradd commands. So it would be easier to write a shell script to copy/paste/modify that code into. So I'd write an exit program, and one line would be to call a script for initializing a sane PASE environment. – Justin Dearing Oct 08 '15 at 16:44
-
Makes sense. Note that besides QSH, there's also QP2SHELL and QP2SHELL2 which directly invoke the PASE shell. [be aware of the requirements of QP2SHELL](http://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_72/apis/qp2shell.htm?lang=en) – Charles Oct 08 '15 at 17:00