Sponsored Content
Operating Systems Solaris How do files transferred via ftp or sftp gets thier permissions at destination? Post 302753791 by kchinnam on Wednesday 9th of January 2013 11:05:16 AM
Old 01-09-2013
Wrench How do files transferred via ftp or sftp gets thier permissions at destination?

We have umask defined under /etc/.login as 022.
I have my user specific umask defined in /userhome/.login as 002.
I understand ftp will not execute anything at destination, it simply transfers files.
But it seem to be using 022 as umask for the files transferred. How does ftp knows what umask to use, where does it get from on Solaris?

Code:
-rw-r--r-- 1 user group 2012 Jan 9 09:59 file.dat

 

10 More Discussions You Might Find Interesting

1. HP-UX

Insufficient permissions on ftp'ed files from WIN2K to HP-UX

We have an application running on Win2K and this application ftp files to HP-UX using ftpdc as user id. The files are created in HP-UX with following permissions: -rw-r----- 1 ftpdc users 968321 Apr 12 22:57 aaaa.txt There is a job that runs on HP-UX trying to modify this file using the... (7 Replies)
Discussion started by: Anamika
7 Replies

2. HP-UX

FTP user files permissions problems!!!

Hi, I have a problem with my ftp accounts whereby if any external ftp party connects to our server and puts any file in a directory on our server. The file permissons are always -rw-r----- and no read for others. I have adjusted the ftp user .profile to include 'umask 022' but this only works... (3 Replies)
Discussion started by: budrito
3 Replies

3. Shell Programming and Scripting

How to know number files transferred

Hi, I am transferring files from our local server to remote server using FTP command in a shell script. I am using a the following code, FTPFILE="ercchk*.txt" mput $FTPFILE can any one help me out in calucalating the number of files transfered. help in this regard is highly... (9 Replies)
Discussion started by: azazalis
9 Replies

4. UNIX for Dummies Questions & Answers

How files can be transferred from one system to another securely using Linux?

i need to know how files can be transfered from one system to another securely in linux. (9 Replies)
Discussion started by: bibing
9 Replies

5. Shell Programming and Scripting

Validating the size of file transferred from ftp server to the local system

Validating the size of file transferred from ftp server to the local system. File type: Text file/Flat file Source System: Windows / Unix Systems Target System is always: Unix Mode of Transfer : ASCII We have generic ftp shell script that transfers the files from different ftp servers. ... (2 Replies)
Discussion started by: jpundalik
2 Replies

6. Shell Programming and Scripting

FTP/SFTP/SCP Files

Hi, I have a process which FTP's the files from one server to another server. Sometimes only half or a part of the file is delivered to remote location, but on the end log says FTP is successful. But ideally file in full is not delivered to remote location. How can i catch these kind of errors... (2 Replies)
Discussion started by: forums123456
2 Replies

7. Shell Programming and Scripting

How to check whether files are transferred or not using ftp?

Hi, i want to execute a shell script which transfers files from one server to another using ftp in unix. How can i check whether the ftp is successful or not.(i.e files are transferred to destination server). because if i am checking the return code of ftp, it always shows 0 (denoting ftp is... (5 Replies)
Discussion started by: Little
5 Replies

8. Shell Programming and Scripting

0kb file transferred in FTP process

We are transferring xml files to remote machine through cronjob @every 5 mins and then will move the files to the backup folder is source server. Sometimes the file is transferred as 0kb to destination server, whereas the file in the source backup folder is completely written. There is no error... (6 Replies)
Discussion started by: Bhavi
6 Replies

9. UNIX for Beginners Questions & Answers

Limit number of files transferred

I've a folder in remote server and it has 50 files. I like to transfer these files by first 10 and next 10 files. I'm using mget command to transfer the files. How to limit the file transfer limit to 10. instead of copying 50 files at a time. Thanks Janarthan (5 Replies)
Discussion started by: Janarthan
5 Replies

10. UNIX for Beginners Questions & Answers

Sftp cannot see folder in destination server

I'm using sftp to connect from a Windows server (User ID is ssh1) to AIX server (User ID ftpeapsg) to access /sftp/ftphrssg/HRSSG/EAPSG in AIX server. User ftpeapsg is created on AIX server. Able to connect to AIX server fine without the need for password however not able to see the folder... (4 Replies)
Discussion started by: userguy
4 Replies
umask(1)                                                                                                                                  umask(1)

NAME
umask - get or set the file mode creation mask SYNOPSIS
/usr/bin/umask [-S] [mask] sh umask [ooo] csh umask [ooo] ksh umask [-S] [mask] The umask utility sets the file mode creation mask of the current shell execution environment to the value specified by the mask operand. This mask affects the initial value of the file permission bits of subsequently created files. If umask is called in a subshell or separate utility execution environment, such as one of the following: (umask 002) nohup umask ... find . -exec umask ... it does not affect the file mode creation mask of the caller's environment. For this reason, the /usr/bin/umask utility cannot be used to change the umask in an ongoing session. Its usefulness is limited to checking the caller's umask. To change the umask of an ongoing session you must use one of the shell builtins. If the mask operand is not specified, the umask utility writes the value of the invoking process's file mode creation mask to standard out- put. sh The user file-creation mode mask is set to ooo. The three octal digits refer to read/write/execute permissions for owner, group, and other, respectively (see chmod(1), chmod(2), and umask(2)). The value of each specified digit is subtracted from the corresponding ``digit'' spec- ified by the system for the creation of a file (see creat(2)). For example, umask 022 removes write permission for group and other. Files (and directories) normally created with mode 777 become mode 755. Files (and directories) created with mode 666 become mode 644). o If ooo is omitted, the current value of the mask is printed. o umask is recognized and executed by the shell. o umask can be included in the user's .profile (see profile(4)) and invoked at login to automatically set the user's permissions on files or directories created. csh See the description above for the Bourne shell (sh)umask built-in. ksh The user file-creation mask is set to mask. mask can either be an octal number or a symbolic value as described in chmod(1). If a symbolic value is given, the new umask value is the complement of the result of applying mask to the complement of the previous umask value. If mask is omitted, the current value of the mask is printed. The following option is supported: -S Produces symbolic output. The default output style is unspecified, but will be recognized on a subsequent invocation of umask on the same system as a mask operand to restore the previous file mode creation mask. The following operand is supported: mask A string specifying the new file mode creation mask. The string is treated in the same way as the mode operand described in the chmod(1) manual page. For a symbolic_mode value, the new value of the file mode creation mask is the logical complement of the file permission bits por- tion of the file mode specified by the symbolic_mode string. In a symbolic_mode value, the permissions op characters + and - are interpreted relative to the current file mode creation mask. + causes the bits for the indicated permissions to be cleared in the mask. - causes the bits of the indicated permissions to be set in the mask. The interpretation of mode values that specify file mode bits other than the file permission bits is unspecified. The file mode creation mask is set to the resulting numeric value. The default output of a prior invocation of umask on the same system with no operand will also be recognized as a mask operand. The use of an operand obtained in this way is not obsolescent, even if it is an octal number. OUTPUT
When the mask operand is not specified, the umask utility will write a message to standard output that can later be used as a umask mask operand. If -S is specified, the message will be in the following format: "u=%s,g=%s,o=%s ", owner permissions, group permissions, other permissions where the three values will be combinations of letters from the set {r, w, x}. The presence of a letter will indicate that the correspond- ing bit is clear in the file mode creation mask. If a mask operand is specified, there will be no output written to standard output. Example 1: Using the umask Command The examples in this section refer to the /usr/bin/umask utility and the ksh umask builtin. Either of the commands: umask a=rx,ug+w umask 002 sets the mode mask so that subsequently created files have their S_IWOTH bit cleared. After setting the mode mask with either of the above commands, the umask command can be used to write the current value of the mode mask: example$ umask 0002 The output format is unspecified, but historical implementations use the obsolescent octal integer mode format. example$ umask -S u=rwx,g=rwx,o=rx Either of these outputs can be used as the mask operand to a subsequent invocation of the umask utility. Assuming the mode mask is set as above, the command: umask g-w sets the mode mask so that subsequently created files have their S_IWGRP and S_IWOTH bits cleared. The command: umask --w sets the mode mask so that subsequently created files have all their write bits cleared. Notice that mask operands r, w, x, or anything beginning with a hyphen (-), must be preceded by - to keep it from being interpreted as an option. See environ(5) for descriptions of the following environment variables that affect the execution of umask: LANG, LC_ALL, LC_COL- LATELC_CTYPE, LC_MESSAGES, and NLSPATH. The following exit values are returned: 0 The file mode creation mask was successfully changed, or no mask operand was supplied. >0 An error occurred. See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ chmod(1), csh(1), ksh(1), sh(1), chmod(2), creat(2), umask(2), profile(4), attributes(5), environ(5), standards(5) 23 Jun 2005 umask(1)
All times are GMT -4. The time now is 08:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy