SUMMARY: FTP and File Permissions

From: <John.Maguire_at_PSIR.ie>
Date: Mon Oct 08 2001 - 11:38:10 EDT
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C1500F.3C3D560E
Content-Type: text/plain; charset="iso-8859-1"

Original question was how to set the permissions on a file once ftp'd to a
target system using the default ftpd in Solaris.
 
I got several responses but Casper hit the nail on the head in suggesting I
use default ACL on the directory. 
 
Other suggestions included
- quote site umask 117 (my version of ftp didnt support this)
- create /etc/default/ftpd with an entry -f umask=117 (didnt try this so I
cant confirm if it works)
- ftp -p which apparently keeps permissions (again, my version doesnt
support this)
- use wu-ftpd and modify the ftpaccess file
- chmod command (my ftpd doesnt support it)
 
Thanks go (in no particular order) to
 
Rasmussen Thorfinn
Casper Dik
William Bochnik
Steve Holdoway
Blaine Owens
Lorraine Coombes
Lincoln Nelson
Craig Russell
Edward Scown
Dan Lowe
 
Thanks,
John
 
 
ORIGINAL QUESTION

seen this asked a few times in the archives but I havn't seen an answer yet.
A search on google proved fruitless. 

I'm trying to ftp a file, for a particular user, to a target system so that
the permissions on the target system are rw- rw- ---.

However, the file, once ftp'd is written to the target as rw- r-- r--. 

I've tried changing the umask of the local and remote user to 117, but to no
avail. 

The following suggestion is made on SunSolve: 

1) First save the original in.ftpd 

       mv /usr/sbin/in.ftpd /usr/sbin/in.ftpd.orig 

2) Create the script so that its contents look like: 

       #!/bin/sh 
       umask 022 
       exec /usr/sbin/in.ftpd.orig 

3) Make sure the script is executable: 

       chmod 755 /usr/sbin/in.ftpd 

Now all files created via FTP will have mode 0644. 



But this will set the file permissions on a system-wide basis, which is not
what I want. 

Does anyone know if this is possible or am I missing something here? 

BTW, I'm using the Sun-supplied ftpd. A third-party ftpd is not an option
for me, nor is a fancy GUI that allows you to set permissions.

Thanks, 
John 




********************************************************************
This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they   
are addressed. If you have received this email in error please 
notify us immediately at MailManager@psir.ie and delete this E-mail 
from your system. Thank you.
It is possible for data transmitted by email to be deliberately or
accidentally corrupted or intercepted. For this reason, where the
communication is by email, the Bank of Ireland Group does not accept 
any responsibility for any breach of confidence which may arise 
through the use of this medium.
This footnote also confirms that this email message has been swept 
 for the presence of known computer viruses.
********************************************************************
  

------_=_NextPart_001_01C1500F.3C3D560E
Content-Type: text/html; charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>FTP and File Permissions</TITLE>

<META content="MSHTML 5.00.2314.1000" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=074591415-08102001>Original question was how to set the permissions on a 
file once ftp'd to a target system using the default ftpd in 
Solaris.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=074591415-08102001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=074591415-08102001>I got 
several responses but Casper hit the nail on the head in suggesting I use 
default ACL on the directory. </SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=074591415-08102001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=074591415-08102001>Other 
suggestions included</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=074591415-08102001>- 
quote site umask 117 (my version of ftp didnt support this)</SPAN></FONT></DIV>
<DIV><SPAN class=074591415-08102001><FONT color=#0000ff face=Arial size=2>- 
create /etc/default/ftpd with an entry -f umask=117 (didnt try this so I cant 
confirm if it works)</FONT></SPAN></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=074591415-08102001>- ftp 
-p which apparently keeps permissions (again, my version doesnt support 
this)</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=074591415-08102001>- use 
wu-ftpd and modify the ftpaccess file</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=074591415-08102001>- 
chmod command (my ftpd doesnt support it)</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=074591415-08102001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=074591415-08102001>Thanks 
go (in no particular order) to</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=074591415-08102001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=074591415-08102001>Rasmussen Thorfinn</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=074591415-08102001>Casper 
Dik</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=074591415-08102001>William Bochnik</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=074591415-08102001>Steve 
Holdoway</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=074591415-08102001>Blaine 
Owens</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=074591415-08102001>Lorraine Coombes</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=074591415-08102001>Lincoln Nelson</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=074591415-08102001>Craig 
Russell</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=074591415-08102001>Edward 
Scown</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=074591415-08102001>Dan 
Lowe</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=074591415-08102001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=074591415-08102001>Thanks,</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=074591415-08102001>John</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=074591415-08102001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=074591415-08102001></SPAN></FONT>&nbsp;</DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN 
class=074591415-08102001>ORIGINAL QUESTION</SPAN></FONT></DIV>
<BLOCKQUOTE>
  <P><FONT face=Arial size=2>seen this asked a few times in the archives but I 
  havn't seen an answer yet. A search on google proved fruitless.</FONT> </P>
  <P><FONT face=Arial size=2>I'm trying to ftp a file, for a particular user, to 
  a target system so that the permissions on the target system are rw- rw- 
  ---.</FONT></P>
  <P><FONT face=Arial size=2>However, the file, once ftp'd is written to the 
  target as rw- r-- r--.</FONT> </P>
  <P><FONT face=Arial size=2>I've tried changing the umask of the local and 
  remote user to 117, but to no avail.</FONT> </P>
  <P><FONT face=Arial size=2>The following suggestion is made on 
  SunSolve:</FONT> </P>
  <P><FONT face="Courier New" size=2>1) First save the original in.</FONT><FONT 
  color=#ff0000 face="Times New Roman" size=2>ftpd</FONT> </P>
  <P><FONT face="Times New Roman" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mv 
  /usr/sbin/in.</FONT><FONT color=#ff0000 face="Times New Roman" 
  size=2>ftpd</FONT><FONT face="Times New Roman" size=2> 
  /usr/sbin/in.</FONT><FONT color=#ff0000 face="Times New Roman" 
  size=2>ftpd.orig</FONT> </P>
  <P><FONT face="Times New Roman" size=2>2) Create the script so that its 
  contents look like:</FONT> </P>
  <P><FONT face="Times New Roman" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  #!/bin/sh</FONT> <BR><FONT face="Times New Roman" 
  size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; umask 022</FONT> <BR><FONT 
  face="Times New Roman" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exec 
  /usr/sbin/in.</FONT><FONT color=#ff0000 face="Times New Roman" 
  size=2>ftpd.orig</FONT> </P>
  <P><FONT face="Times New Roman" size=2>3) Make sure the script is 
  executable:</FONT> </P>
  <P><FONT face="Times New Roman" size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  chmod 755 /usr/sbin/in.</FONT><FONT color=#ff0000 face="Times New Roman" 
  size=2>ftpd</FONT> </P>
  <P><FONT face="Times New Roman" size=2>Now all </FONT><FONT color=#ff0000 
  face="Times New Roman" size=2>files</FONT><FONT face="Times New Roman" size=2> 
  created via </FONT><FONT color=#ff0000 face="Times New Roman" 
  size=2>FTP</FONT><FONT face="Times New Roman" size=2> will have mode 
  0644.</FONT> </P><BR><BR>
  <P><FONT face=Arial size=2>But this will set the file permissions on a 
  system-wide basis, which is not what I want. </FONT></P>
  <P><FONT face=Arial size=2>Does anyone know if this is possible or am I 
  missing something here?</FONT> </P>
  <P><FONT face=Arial size=2>BTW, I'm using the Sun-supplied ftpd. A third-party 
  ftpd is not an option for me, nor is a fancy GUI that allows you to set 
  permissions.</FONT></P>
  <P><FONT face=Arial size=2>Thanks,</FONT> <BR><FONT face=Arial 
  size=2>John</FONT> <CODE><FONT 
size=3><BR></P></BLOCKQUOTE></FONT></CODE><CODE><FONT SIZE=3><BR>
<BR>
********************************************************************<BR>
This email and any files transmitted with it are confidential and <BR>
intended solely for the use of the individual or entity to whom they   <BR>
are addressed. If you have received this email in error please <BR>
notify us immediately at MailManager@psir.ie and delete this E-mail <BR>
from your system. Thank you.<BR>
It is possible for data transmitted by email to be deliberately or<BR>
accidentally corrupted or intercepted. For this reason, where the<BR>
communication is by email, the Bank of Ireland Group does not accept <BR>
any responsibility for any breach of confidence which may arise <BR>
through the use of this medium.<BR>
This footnote also confirms that this email message has been swept <BR>
 for the presence of known computer viruses.<BR>
********************************************************************<BR>
  <BR>
</FONT></CODE></BODY></HTML>

------_=_NextPart_001_01C1500F.3C3D560E--
Received on Mon Oct 8 16:38:10 2001

This archive was generated by hypermail 2.1.8 : Wed Mar 23 2016 - 16:32:33 EDT