<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: FTP scptiing question in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746516#M22079</link>
    <description>File permissions would be controlled from the Linux side based on umask value. If you need the files to have 666 permissions when downloaded, you could put "umask 000" prior to the ftp in your script.</description>
    <pubDate>Wed, 08 Mar 2006 14:53:42 GMT</pubDate>
    <dc:creator>Jeff_Traigle</dc:creator>
    <dc:date>2006-03-08T14:53:42Z</dc:date>
    <item>
      <title>FTP scptiing question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746513#M22076</link>
      <description>Greetings,&lt;BR /&gt;I need help with renaming a file during my FTP script execution from my Linux server RHAS 3.0 to my Windows FTP server.  Also, what would be the best way to pickup a long file name, such as PAAAAAPAAAAA20060307.txt and rename from PAAAAA20060307.txt to PAAAAA20060307.old after I am done with the FTP procedure?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;J</description>
      <pubDate>Tue, 07 Mar 2006 20:34:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746513#M22076</guid>
      <dc:creator>Jorge Cocomess</dc:creator>
      <dc:date>2006-03-07T20:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scptiing question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746514#M22077</link>
      <description>hi J,&lt;BR /&gt;&lt;BR /&gt;you can include it in script that will run after the ftp operation:&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;filelist=`ls -1 *.txt`&lt;BR /&gt;for filen in $filelist; do&lt;BR /&gt;  new=`echo ${filen} |sed s/txt/old/g`&lt;BR /&gt;  mv ${filen} $new&lt;BR /&gt;  echo renamed $filen to $new&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Tue, 07 Mar 2006 23:47:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746514#M22077</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2006-03-07T23:47:14Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scptiing question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746515#M22078</link>
      <description>Thanks for your response.  How do I retain the file's permission coming down from the Windows side?  Seems though, the linux side stripped all the permissions.  I had to manually modify the permission by chmod 666 test_file.txt&lt;BR /&gt;&lt;BR /&gt;Any ideas??</description>
      <pubDate>Wed, 08 Mar 2006 14:42:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746515#M22078</guid>
      <dc:creator>Jorge Cocomess</dc:creator>
      <dc:date>2006-03-08T14:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scptiing question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746516#M22079</link>
      <description>File permissions would be controlled from the Linux side based on umask value. If you need the files to have 666 permissions when downloaded, you could put "umask 000" prior to the ftp in your script.</description>
      <pubDate>Wed, 08 Mar 2006 14:53:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746516#M22079</guid>
      <dc:creator>Jeff_Traigle</dc:creator>
      <dc:date>2006-03-08T14:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scptiing question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746517#M22080</link>
      <description>Per your suggestion, it doesn't work with umask 000 - Seems though it doesn't even care about the command "umask".&lt;BR /&gt;&lt;BR /&gt;What am I missing here?  Here's an example:&lt;BR /&gt;&lt;BR /&gt;fooo01&lt;BR /&gt;foolprof&lt;BR /&gt;prompt&lt;BR /&gt;umask 000&lt;BR /&gt;lcd e:\ftpusers\temp\IN&lt;BR /&gt;cd /u09/data/bin/in&lt;BR /&gt;ascii&lt;BR /&gt;mput *test_file*.txt&lt;BR /&gt;bye</description>
      <pubDate>Wed, 08 Mar 2006 16:12:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746517#M22080</guid>
      <dc:creator>Jorge Cocomess</dc:creator>
      <dc:date>2006-03-08T16:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scptiing question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746518#M22081</link>
      <description>The umask command is outside the ftp command, not part of the commands you'll run within the ftp session. There is a umask command within ftp, but that only applies to files you are sending to the server. Something like this is what you want to do:&lt;BR /&gt;&lt;BR /&gt;umask 000&lt;BR /&gt;ftp server &amp;lt;&amp;lt; EOD&lt;BR /&gt;your ftp commands here&lt;BR /&gt;EOD</description>
      <pubDate>Wed, 08 Mar 2006 16:34:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746518#M22081</guid>
      <dc:creator>Jeff_Traigle</dc:creator>
      <dc:date>2006-03-08T16:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scptiing question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746519#M22082</link>
      <description>As you can tell, I am very new to Linux.  Could you please spell out what does it mean to run outside of my FTP script but in the same FTP session?&lt;BR /&gt;&lt;BR /&gt;Please help!&lt;BR /&gt;&lt;BR /&gt;Thank you!</description>
      <pubDate>Wed, 08 Mar 2006 17:04:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746519#M22082</guid>
      <dc:creator>Jorge Cocomess</dc:creator>
      <dc:date>2006-03-08T17:04:43Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scptiing question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746520#M22083</link>
      <description>The lines I included in my previous post should be included in a script and made executable.&lt;BR /&gt;&lt;BR /&gt;vi ftpscript.sh and insert the following lines:&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;umask 000&lt;BR /&gt;your ftp command here&lt;BR /&gt;&lt;BR /&gt;Make it executable:&lt;BR /&gt;chmod u+x ftpscript.sh&lt;BR /&gt;&lt;BR /&gt;Run it.</description>
      <pubDate>Wed, 08 Mar 2006 17:20:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746520#M22083</guid>
      <dc:creator>Jeff_Traigle</dc:creator>
      <dc:date>2006-03-08T17:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scptiing question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746521#M22084</link>
      <description>Maybe I'm not explaining clearly what I'm trying to do.... Here go, I am trying to run my FTP script from a Windows server to a Linux server.  The script is working okay with an exception of the permission issue on the Linux server.  Again, the script is execute from the Windows server, not from the Linux server.&lt;BR /&gt;&lt;BR /&gt;Now, what I can tell is that when I typed unmask, I can see it was set 022 by default.  if I set the umask to 777 (umask 777 test_account) - this would work just fine.  How do I make this umask 777 to set permanently for this account?  &lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;J</description>
      <pubDate>Wed, 08 Mar 2006 22:12:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746521#M22084</guid>
      <dc:creator>Jorge Cocomess</dc:creator>
      <dc:date>2006-03-08T22:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scptiing question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746522#M22085</link>
      <description>hi J,&lt;BR /&gt;will it be possible to do the FTP from the Linux server instead?&lt;BR /&gt;&lt;BR /&gt;would be then "mget" instead of "mput"?&lt;BR /&gt;&lt;BR /&gt;there may be some configuration required on the FTP server.&lt;BR /&gt;&lt;BR /&gt;revert&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Wed, 08 Mar 2006 23:23:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746522#M22085</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2006-03-08T23:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scptiing question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746523#M22086</link>
      <description>yogeeraj - Yes, that's what I did recently or last night.  I'm doing a pull from the Linux box and once the files are pulled down, I do a chmod to 666 and that's it.  I can setup the cron to run every hour per there request.&lt;BR /&gt;&lt;BR /&gt;Please let me know if I'm on the right track or not.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;J</description>
      <pubDate>Thu, 09 Mar 2006 08:50:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746523#M22086</guid>
      <dc:creator>Jorge Cocomess</dc:creator>
      <dc:date>2006-03-09T08:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scptiing question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746524#M22087</link>
      <description>Ok. You lost me. I didn't notice you were using mput. I just read you were trying to go from the Linux server to you Windows server in the initial post.&lt;BR /&gt;&lt;BR /&gt;If you want the umask for the user to be 000 (so file permissions are 666), you can add the "umask 000" to the user's .profile or .bashrc in the home directory. However, this will only affect login sessions. I think you can set the umask for the cron job in Linux's cron implementation so you wouldn't need to do the chmod in your script. Or using chmod after the ftp, as you've done, will work too.</description>
      <pubDate>Thu, 09 Mar 2006 09:31:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746524#M22087</guid>
      <dc:creator>Jeff_Traigle</dc:creator>
      <dc:date>2006-03-09T09:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scptiing question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746525#M22088</link>
      <description>Great!  I will try out your suggestion and let you know.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;J</description>
      <pubDate>Thu, 09 Mar 2006 12:16:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746525#M22088</guid>
      <dc:creator>Jorge Cocomess</dc:creator>
      <dc:date>2006-03-09T12:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scptiing question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746526#M22089</link>
      <description>hi again,&lt;BR /&gt;&lt;BR /&gt;in fact, if you have inetd you could just configure your ftp services on your linux server such that all file uploaded gets a predetermined mode.&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;ftp stream tcp nowait root /usr/lbin/ftpd      ftpd -l  -u 002 -a &lt;BR /&gt;&lt;BR /&gt;please check.&lt;BR /&gt;&lt;BR /&gt;(in my suse linux at hand,we don't have it. On hp-ux, we do have it. On redhat, we need to install the inetd package)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Thu, 09 Mar 2006 23:19:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746526#M22089</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2006-03-09T23:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scptiing question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746527#M22090</link>
      <description>Guess what?  I do have inetd installed.  Do I created an user ftp-test account, do I just remove root and replace it ftp-test?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;J</description>
      <pubDate>Fri, 10 Mar 2006 17:49:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746527#M22090</guid>
      <dc:creator>Jorge Cocomess</dc:creator>
      <dc:date>2006-03-10T17:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scptiing question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746528#M22091</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;thats good news :)&lt;BR /&gt;&lt;BR /&gt;I have not tried it on linux.&lt;BR /&gt;&lt;BR /&gt;On hp-ux, we have setup ftponly accounts.&lt;BR /&gt;&lt;BR /&gt;will try to get you some notes on how it was done on hpux.&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Sat, 11 Mar 2006 00:10:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746528#M22091</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2006-03-11T00:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: FTP scptiing question</title>
      <link>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746529#M22092</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;can you please try this?&lt;BR /&gt;&lt;BR /&gt;=============================&lt;BR /&gt;1. Create a bogus shell like /usr/bin/ftponly - just put a message in there in case he tries to login on server: Create a group, like "ftpgroup" and put him in it.&lt;BR /&gt;&lt;BR /&gt;Example bogus shell:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;/usr/bin/cat &amp;lt;&amp;lt; XX&lt;BR /&gt;***********************************************************************************************&lt;BR /&gt;* ACCESS DENIED: You may use FTP, but you may not login with this account! *&lt;BR /&gt;***********************************************************************************************&lt;BR /&gt;XX&lt;BR /&gt;/usr/bin/sleep 5&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;2. Edit (or create) /etc/shells that looks like this (make sure that it includes your bogus shell) :&lt;BR /&gt;&lt;BR /&gt;/usr/bin/sh&lt;BR /&gt;/sbin/sh&lt;BR /&gt;/usr/bin/ksh&lt;BR /&gt;/usr/bin/csh&lt;BR /&gt;/usr/bin/ftponly&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;3. For true "restricted" ftp accounts, Edit user in /etc/passwd with vipw:&lt;BR /&gt;&lt;BR /&gt;(These accounts will not have a regular shell, so they cannot telnet.)&lt;BR /&gt;&lt;BR /&gt;Change the home directory entry to put the "root" level that you want this user to be able see on one side of a period (.)&lt;BR /&gt;The other side of the period is where he intially lands (relative to the new "root") in when he ftps to the server.&lt;BR /&gt;&lt;BR /&gt;Example:&lt;BR /&gt;&lt;BR /&gt;ftpuser:jo/469sTHoYRQ:105:101:ftp account,,,:/opt/apache/ftpdir/./:/usr/bin/ftponly&lt;BR /&gt;&lt;BR /&gt;Do NOT forget the trailing "/" just before the separating "." between the directories above.&lt;BR /&gt;&lt;BR /&gt;4. For "restricted" ftp accounts, you also need to create or edit /ftpd/ftpaccess&lt;BR /&gt;(See ftpaccess manpage for mind-boggling details.)&lt;BR /&gt;&lt;BR /&gt;Example /etc/ftpd/ftpaccess:&lt;BR /&gt;&lt;BR /&gt;class all real,guest *&lt;BR /&gt;guestgroup www ftpgroup&lt;BR /&gt;upload * * yes * * 0775 dirs&lt;BR /&gt;&lt;BR /&gt;My understanding of the above:&lt;BR /&gt;&lt;BR /&gt;# defines a "class" of all, real, and anything starting with guest*&lt;BR /&gt;&lt;BR /&gt;# defines 2 "guestgroup" "groupnames," called "www" and "ftpgroup" --- if an ftp user is a REAL /etc/passwd account AND the user belongs to one of these groups, then their ftp session is treated just like anonymous ftp. If a user is in one of these groups they cannot cd to anything outside of their home directory, cannot change user, or password, etc.&lt;BR /&gt;&lt;BR /&gt;# allow "upload" access to any directory, ownership group will be those of the ftp user, directories may be created&lt;BR /&gt;&lt;BR /&gt;When you setup a user like this, the user acts just like an anonymous ftp account. So, ftpd does a chroot to the selected directory. However, no files, libraries, etc that are outside this restricted piece of the file system are available anymore to this user. So commands like ls won't work anymore. To just get ls working, you need to create a local usr/bin under the new "root" directory. Change the permissions on these dirs to 555 - owned by root. Then copy /sbin/ls into the new usr/bin and chown to root and chmod 111 on the ls executable.&lt;BR /&gt;&lt;BR /&gt;5. Put ANY (restricted or not) logins that you do NOT want to ftp in /etc/ftpd/ftpusers.&lt;BR /&gt;&lt;BR /&gt;Hint: use the following command to create the file (NO ONE on this list will be able to ftp):&lt;BR /&gt;&lt;BR /&gt;cat /etc/passwd | awk -F: '{print $1}' &amp;gt; /etc/ftpd/ftpusers&lt;BR /&gt;&lt;BR /&gt;Then remove those users that you DO want to ftp from ftpusers.&lt;BR /&gt;&lt;BR /&gt;6, Setup the ftpd entry in inetd.conf like this:&lt;BR /&gt;&lt;BR /&gt;ftp stream tcp nowait root /usr/lbin/ftpd ftpd -a&lt;BR /&gt;&lt;BR /&gt;(note: ftpaccess file must exist!)&lt;BR /&gt;&lt;BR /&gt;(The ftpd -a tells the daemon to access the /etc/ftpd/ftpaccess configuration file.)&lt;BR /&gt;&lt;BR /&gt;7. Restart inetd like this inetd -c (works on hp-ux).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Sat, 11 Mar 2006 00:16:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/ftp-scptiing-question/m-p/3746529#M22092</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2006-03-11T00:16:18Z</dc:date>
    </item>
  </channel>
</rss>

