Solved

Controlling a profile's initial directory when using FTP

Posted on 2006-11-09
10
438 Views
Last Modified: 2008-01-09
A client needs to send us a file via FTP.  How do I force the user profile they will be using to a specific folder on the IFS?  Without changing directories, I think the file will be placed in QGPL.
0
Comment
Question by:roosterup
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 13

Expert Comment

by:samic400
ID: 17907127
Would the HOME DIRECTORY parameter on the user profile work? Haven't used it but I believe that would be where they would start for a directory.
0
 
LVL 1

Author Comment

by:roosterup
ID: 17907147
I thought that too, it didn't work.
0
 
LVL 1

Author Comment

by:roosterup
ID: 17907169
It is possible to use a cd command and change the directory, but i don't want them to do that.  It would be nice if the dir was already set.  

Limiting their access to just the desired dir would be great.
0
On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

 
LVL 14

Accepted Solution

by:
daveslater earned 50 total points
ID: 17907254
hi
in the command CHGFTPA
you have 2 choices

 Initial directory  . . . . . . .   *CURLIB    or *HOMEDIR

you need to set it to *HOMEDIR  to use the directory in the user profile

Dave
0
 
LVL 13

Assisted Solution

by:_b_h
_b_h earned 50 total points
ID: 17907315
You can use the Change FTP Attributes (CHGFTPA) command to set the default name format and default directory.
If you set 'Initial name format' to *PATH and 'Initial directory' to *HOMEDIR:
CHGFTPA NAMEFMT(*PATH)  CURDIR(*HOMEDIR)
then the user's ftp session will start with the home directory from their user profile, BUT this change will apply to all users. You can't have some users default to the QSYS system using *CURLIB and others to *PATH.

You will also need security in place to control their activities. For example, they can change to any directory they are authorized to:
cd mydir  OR cd \qsys.lib\qgpl.lib
or they can execute commands that they are authorized to by using:
quote rcmd endsbs *all *immed

Barry
0
 
LVL 1

Author Comment

by:roosterup
ID: 17907324
Thanks daveslater, i will check this out.  

i'm wondering if this would cause problems for others sending us files.  Maybe I'll have to change everyone?  
0
 
LVL 1

Author Comment

by:roosterup
ID: 17907448
If i change the CURDIR to *HOMEDIR, what do i do about those that upload to QSYS?

Could i change the home directory for those that are uploading to the QSYS system to /QSYS.LIB/QGPL.LIB/ ?
0
 
LVL 13

Expert Comment

by:_b_h
ID: 17907495
They will find the right directory, but will have to use the correct name format to transfer files, so their scripts will have to change

Barry
0
 
LVL 1

Author Comment

by:roosterup
ID: 17907574
awesome.
0
 
LVL 27

Expert Comment

by:tliotta
ID: 17911161
roosterup:

If you need individual control over the current directory for FTP, you'll need to write an exit program for the FTP server logon exit point, QIBM_QTMF_SVR_LOGON, using format TCPL0200. Not a particularly big deal; an example of a basic FTP exit program written in CL is shown at:

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/rzaiq/rzaiqexamplogoncl.htm

There are examples in C and RPG also. The parent topic gives an overview that mentions the capabilities of the exit point:

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/rzaiq/rzaiqlepi.htm

The links are for V5R4, but the info has hardly changed for years. All kinds of related info is in topics surrounding it.

Because this can be tailored to check for specific users (or IP addresses, etc.), it won't affect all users -- just the ones that you choose to affect.

Tom
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a serious pitfall that can happen when deleting shapes using VBA.
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question