1752801 Members
5562 Online
108789 Solutions
New Discussion юеВ

ftpshell and umask

 
Shabu Khan-2
Frequent Advisor

ftpshell and umask



Folks,
FTP Client Server: SOlaris 8
FTP Server: 11.11/S16K-A

One of my users needs ftp access to a production system (he is stuck with ftp since all his scripts are ftp scripts and cannot switch to sftp), I set him up with /usr/bin/ftpshell as his shell, all I've in ftpshell is 'exit 1', the ownership/permissions to the ftpshell are bin:bin/555.
It works.

His scripts run from a solaris 8 machine (FTP client).

The default umask system-wide is 022 (755), but when he puts files it inherits 640, I want it to be 644 (by default, when he puts files into this directory), should I be messing with ftpaccess file? I want this specific for this user only - all his files should be 644 since there are other groups that needs access (Read only) and I can't put them in the 'group'

I need a quick fix - no time for chroot/sftp or anything of that sort, we will slowly switch him to sftp - hopefully soon, but for now, need a temporary fix to the current setup.

Please advise.

Thanks,
Shabu
6 REPLIES 6
TwoProc
Honored Contributor

Re: ftpshell and umask

"chmod" is a valid ftp command.
Just put the chmod command in the script this is being run and set it however it needs to be.
We are the people our parents warned us about --Jimmy Buffett
Shabu Khan-2
Frequent Advisor

Re: ftpshell and umask

chmod/umask is not a valid command on the ftp client that solaris 8 ships with, that would have been too easy ...
TwoProc
Honored Contributor

Re: ftpshell and umask

Ok, simple. Convert to HPUX. :-)
We are the people our parents warned us about --Jimmy Buffett
Steven E. Protter
Exalted Contributor

Re: ftpshell and umask

Shalom Shabu,

BTW, normally its a very minor change to take an ftp script to sftp. If you give me a sample, I'll show you what I mean. Also, you can go password free with sftp making the authentication work without hardcoding it into scripts.

To your question:

ftpaccess

That file can be used to configure a default umask. So long as you don't want execute, which will not be permitted.

How is that for simple?

http://www.wu-ftpd.org/man/ftpaccess.html
http://forums.macosxhints.com/archive/index.php/t-13827.html

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Shabu Khan-2
Frequent Advisor

Re: ftpshell and umask


Thanks Steve.
I messed with ftpaccess and used the upload directive and was able to get that working.

I understand converting to sftp would be easier with the auth keys in place and all that, but it is out of my control, my user has over a dozen scripts that he needs to modifiy, eventually we will have him take the sftp/ssh route.

Thanks for your assistance.

Thanks,
Shabu
Shabu Khan-2
Frequent Advisor

Re: ftpshell and umask

Closing this out.