Topic "Permission Denied on Updates"

Author Message
gpin

Guest


When trying to update files I get "Permission denied" error even though file and parent directories are group write (rw-rw-r--). I am in the group for those files I'm trying to update but not the owner. I can overwrite the file in an SSH session or via command line SCP so server permissions are setup fine. My workaround, while using WinSCP, is to delete the file then upload it again.

Client: XP SP2 / WinSCP 3.7.1 (B 257) in Explorer-like view; Upload set permissions to (rw-rw-r) w/ add X to directories; / Putty 0.56

Server: SSH protocol 2, OpenSSH_3.1p1, Encryption: aes, compression no; protocol SFTP(v3) - Server does not support any SFTP extension.

Not sure if this is a misconfiguration or a bug in WinSCP. In previous versions we didn't have this problem (don't know which version that was though). If anyone has suggestions or something they want me to verify let me know.

Also, I use WinSCP everyday and it's an excellent product. Thanks for the hard work prikryl.

----- START Protocol: SFTP (with SCP fallback) Logging -----
Copying 1 files/directories to remote directory "/opt/htdocs"
PrTime: Yes; PrRO: Yes; Rght: rw-rw-r--; PrR: Yes; FnCs: N; RIC: Yes; Resume: S (102400); CalcS: Yes; Mask: *.*
TM: M; ClAr: No; ExclM:
AscM: *.*html; *.htm; *.txt; *.php*; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
File: "\\<server>\<myfile>.pdf"
Copying "\\<server>\<myfile>.pdf" to remote directory started.
Binary transfer mode selected.
Opening remote file.
Type: SSH_FXP_OPEN, Size: 116, Number: 65283
Type: SSH_FXP_STATUS, Size: 24, Number: 65283
Status/error code: 4, Message: 65283, Server: Failure, Language:
Type: SSH_FXP_LSTAT, Size: 100, Number: 65543
Type: SSH_FXP_ATTRS, Size: 37, Number: 65543
Asking user:
Remote file '<myfile>.pdf' already exists. Overwrite?

New: 53725 bytes, 11/9/2004 5:18:12 PM
Existing: 53725 bytes, 11/10/2004 8:51:00 AM ()
Type: SSH_FXP_OPEN, Size: 116, Number: 65795
Type: SSH_FXP_HANDLE, Size: 13, Number: 65795
Type: SSH_FXP_WRITE, Size: 4121, Number: 66054
27 skipped SSH_FXP_WRITE, SSH_FXP_READ, SSH_FXP_DATA and SSH_FXP_STATUS packets.
Type: SSH_FXP_CLOSE, Size: 13, Number: 69636
Type: SSH_FXP_STATUS, Size: 24, Number: 69636
Status/error code: 0
Type: SSH_FXP_SETSTAT, Size: 116, Number: 69897
Type: SSH_FXP_STATUS, Size: 34, Number: 69897
Status/error code: 3, Message: 69897, Server: Permission denied, Language:
(ETerminal) Permission denied.
Error code: 3
Error message from server: Permission denied
Request code: 9
Asking user:
Upload of file '<myfile>.pdf' was successful, but error occurred while setting the permissions and/or timestamp. If the problem persists, turn off 'Set permissions' and/or 'Preserve timestamp' option. ("Permission denied.
Error code: 3
Error message from server: Permission denied
Request code: 9")
(EScpSkipFile) Upload of file '<myfile>.pdf' was successful, but error occurred while setting the permissions and/or timestamp. If the problem persists, turn off 'Set permissions' and/or 'Preserve timestamp' option.
Permission denied.
Error code: 3
Error message from server: Permission denied
Request code: 9
Listing directory "\\<server>\<path>".
Type: SSH_FXP_OPENDIR, Size: 82, Number: 70155
Type: SSH_FXP_HANDLE, Size: 13, Number: 70155
Type: SSH_FXP_READDIR, Size: 13, Number: 70412
Type: SSH_FXP_NAME, Size: 1057, Number: 70412
Type: SSH_FXP_READDIR, Size: 13, Number: 70668
Type: SSH_FXP_STATUS, Size: 28, Number: 70668
Status/error code: 1
Type: SSH_FXP_CLOSE, Size: 13, Number: 70916
Type: SSH_FXP_STATUS, Size: 24, Number: 70916
Status/error code: 0
----- END Protocol: SFTP (with SCP fallback) Logging -----



----- START Protocol: SCP (only) Logging -----
Copying 1 files/directories to remote directory "/opt/htdocs/"
PrTime: Yes; PrRO: Yes; Rght: rw-rw-r--; PrR: Yes; FnCs: N; RIC: Yes; Resume: S (102400); CalcS: Yes; Mask: *.*
TM: M; ClAr: No; ExclM:
AscM: *.*html; *.htm; *.txt; *.php*; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
echo "WinSCP: this is begin-of-file" ; scp -r -p -d -t "/opt/htdocs/" ; echo "WinSCP: this is end-of-file:$?"
WinSCP: this is begin-of-file
SCP remote side confirmation (0)
Asking user:
Remote file '<myfile>.pdf' already exists. Overwrite?

New: 212304 bytes, 5/4/2004 8:50:02 AM
Existing: 212304 bytes, 5/4/2004 1:22:07 PM ()
File: "\\<myserver>\<myfile>.pdf"
Copying "\\<myserver>\<myfile>.pdf" to remote directory started.
Binary transfer mode selected.
T1083682202 0 1095778325 0
SCP remote side confirmation (0)
C0664 212304 <myfile>.pdf
SCP remote side confirmation (0)
Sending BINARY data (first block)
Sending NULL.
scp: /opt/htdocs/<myfile>.pdf: set mode: Operation not permitted
SCP remote side error (1):
Asking user:
Copying file '\\<myserver>\<myfile>.pdf' failed. ("scp: /opt/htdocs/<myfile>.pdf: set mode: Operation not permitted")
(EScpFileSkipped) scp: /opt/htdocs/<myfile>.pdf: set mode: Operation not permitted
E
scp: /opt/htdocs/<myfile>.pdf: set times: Operation not permitted
SCP remote side error (1):
(EScpFileSkipped) scp: /opt/htdocs/<myfile>.pdf: set times: Operation not permitted
Listing current directory.
ls -la --full-time ; echo "WinSCP: this is end-of-file:$?"
(ECommand) Error listing directory '/opt/htdocs/'.
Unexpected directory listing line '
Invalid rights description ''
----- END Protocol: SCP (only) Logging -----
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
You get the "Permission denied" because you are tring to modify file permissions while you are probably not owner of the file. If you read the error message carefoully you would see a reason and solution Smile
_________________
Martin Prikryl
gpin

Guest


Correct, I am not the owner of the file but belong to the group that owns the file. The file is group+writeable which means I should be able to overwrite the file. I CAN overwrite the file when not using WinSCP such as via ssh command line or scp so server permissions are setup correctly. When using WinSCP I get the errors posted above. Seems to me it's a problem with how WinSCP determines group permissions or I have something configured wrong in WinSCP.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Ok, second attempt to explain.

Quote:
Upload of file '<myfile>.pdf' was successful, but error occurred while setting the permissions and/or timestamp. If the problem persists, turn off 'Set permissions' and/or 'Preserve timestamp' option.

The message says that the file WAS OVERWRITTEN. So you can do this as with other clients. What has failed was attempt to change file attributes. You have checked both "Set permissions" and "Preserve timestamp". These two options does not work when you are not owner of the file. Uncheck them.

In fact I have just wrote you again what the error message says. I hope it is clear this time.
_________________
Martin Prikryl
Guest




prikryl wrote:
The message says that the file WAS OVERWRITTEN. So you can do this as with other clients. What has failed was attempt to change file attributes. You have checked both "Set permissions" and "Preserve timestamp". These two options does not work when you are not owner of the file. Uncheck them.


How do you disable these options in script/batch mode?

I have a perl script that calls winscp3, but this error message causes it to hang.

I tried looking in the help file, but permisison/time stamps arent listed in "options"

Thanks!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Quote:
How do you disable these options in script/batch mode?

It is not possible yet. You may disable the options permanently in GUI preferences first. The script will use the preferred options.
_________________
Martin Prikryl
Guest




prikryl wrote:
Quote:
How do you disable these options in script/batch mode?

It is not possible yet. You may disable the options permanently in GUI preferences first. The script will use the preferred options.


Thanks -

I realized that my problem was an ID 10 T error: I had read that the option "batch On" automatically replied negatively to any prompt, but I didnt realize that "Confirm Off" superceded this, and allowed get/puts.

Thanks!

Once again, WinSCP really is an awesome tool!
Mike The KID

Guest


Quote:
You have checked both "Set permissions" and "Preserve timestamp". These two options does not work when you are not owner of the file. Uncheck them.


I'm having the same problem and went in to the transfer settings and unchecked the permissions and the timestamp but I still get the same permission denied error. What now?
Mike The KID

Guest


Mike The KID wrote:
Quote:
You have checked both "Set permissions" and "Preserve timestamp". These two options does not work when you are not owner of the file. Uncheck them.


I'm having the same problem and went in to the transfer settings and unchecked the permissions and the timestamp but I still get the same permission denied error. What now?


Nevermind. I was only unchecking the timestamp and permissions on the Transfers->Presests options, once I just unchecked them on the main Transfers menu it worked.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License