LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   permission denied when uploading a local file (https://www.linuxquestions.org/questions/linux-newbie-8/permission-denied-when-uploading-a-local-file-931962/)

johnifanx98 02-29-2012 10:44 AM

permission denied when uploading a local file
 
the file permission is admin:sole-group = rw:rw

I add the user "support" into the group of "sole-group" and use it to upload the file, and got this error.

I suspect the group membership is not correctly configured. The id only shows the main group id of the user "support", though /etc/group shows the user "support" indeed is in the group of sole-group.

What could be wrong?

TB0ne 02-29-2012 10:56 AM

Quote:

Originally Posted by johnifanx98 (Post 4615166)
the file permission is admin:sole-group = rw:rw

I add the user "support" into the group of "sole-group" and use it to upload the file, and got this error.

I suspect the group membership is not correctly configured. The id only shows the main group id of the user "support", though /etc/group shows the user "support" indeed is in the group of sole-group.

What could be wrong?

No idea, since you don't tell us how you're uploading the file, what the permissions are on the mount point, what the client is running, and what version/distro of Linux you're using on the server. Without details, we can't help.

johnifanx98 02-29-2012 12:22 PM

Quote:

Originally Posted by TB0ne (Post 4615177)
No idea, since you don't tell us how you're uploading the file, what the permissions are on the mount point, what the client is running, and what version/distro of Linux you're using on the server. Without details, we can't help.

Code:


[support@myhost]$ ls backup
-rw-rw----  1 admin sole-group 925962 Feb  7 14:42 backup

[support@myhost]$less /etc/group |grep sole-group
sole-group:x:501:admin,support

[support@myhost]$id
uid=499(support) gid=499(support) groups=499(support)

Linux ****** 2.6.18.*** #1 SMP Fri Aug 8 16:58:09 EDT 2008 i686 i686 i386 GNU/Linux

I use ftp to upload the file "backup" interactively to an external ftp server. It's OK when I upload the same file under root.

TB0ne 02-29-2012 12:45 PM

Quote:

Originally Posted by johnifanx98 (Post 4615247)
Code:


[support@myhost]$ ls backup
-rw-rw----  1 admin sole-group 925962 Feb  7 14:42 backup

[support@myhost]$less /etc/group |grep sole-group
sole-group:x:501:admin,support

[support@myhost]$id
uid=499(support) gid=499(support) groups=499(support)

Linux ****** 2.6.18.*** #1 SMP Fri Aug 8 16:58:09 EDT 2008 i686 i686 i386 GNU/Linux

I use ftp to upload the file "backup" interactively to an external ftp server. It's OK when I upload the same file under root.

Ok...so you're using FTP to upload the "backup" file, and you posted some things above, but don't say what they're for.

Are those the details for the CLIENT or the SERVER? Does the directory on the remote server have permissions for anyone but non-root people to write to it? What FTP server are you using? What client? Has this ever worked???

johnifanx98 02-29-2012 12:58 PM

Quote:

Originally Posted by TB0ne (Post 4615263)
Ok...so you're using FTP to upload the "backup" file, and you posted some things above, but don't say what they're for.

Are those the details for the CLIENT or the SERVER? Does the directory on the remote server have permissions for anyone but non-root people to write to it? What FTP server are you using? What client? Has this ever worked???

All info is from client side.

Code:

[support@myhost]$ ftp external-ftp-server
Connected to xx.xx.xx.xx.
220-FileZilla Server version 0.9.40 beta
220-written by Tim Kosse (Tim.Kosse@gmx.de)
220 Please visit http://sourceforge.net/projects/filezilla/
502 GSSAPI authentication not implemented
504 Auth type not supported
KERBEROS_V4 rejected as an authentication type
Name (myhost:support): upload-username
331 Password required for upload-username
Password:
230 Logged on
Remote system type is UNIX.
ftp> lcd ../folder-for-backup
Local directory now folder-for-backup
ftp> put autobackup
local: autobackup remote: autobackup
local: autobackup: Permission denied
ftp>

The file to be uploaded belongs to user/group admin/sole-group, so I added user support to group sole-group to have read access to it.
When I upload a file belonging to user support itself, it's no problem.
When I upload the same file under root, it's no problem.
For root and support, I use the same upload-user, so I think the problem is with the privilege of user support locally...

TB0ne 02-29-2012 02:34 PM

Quote:

Originally Posted by johnifanx98 (Post 4615279)
All info is from client side.

...which doesn't have anything to do with the permissions on the remote server.
Quote:

The file to be uploaded belongs to user/group admin/sole-group, so I added user support to group sole-group to have read access to it.
When I upload a file belonging to user support itself, it's no problem.
When I upload the same file under root, it's no problem.
For root and support, I use the same upload-user, so I think the problem is with the privilege of user support locally...
The user id on the remote server has to have permissions on that server, to write to the directory on that server. Your local user/group doesn't enter into the equation at all.

Change the permissions on the remote directory to allow user writes. You still don't say anything about the remote server, or address any of the other questions asked, so there's little more we can say.

johnifanx98 02-29-2012 02:49 PM

Quote:

Originally Posted by TB0ne (Post 4615333)
...which doesn't have anything to do with the permissions on the remote server.

The user id on the remote server has to have permissions on that server, to write to the directory on that server. Your local user/group doesn't enter into the equation at all.

Change the permissions on the remote directory to allow user writes. You still don't say anything about the remote server, or address any of the other questions asked, so there's little more we can say.

Let me clarify this more.

scenario one
============
login as root, start a FTP client connecting to remote FTP server. The credentials for FTP are upload/password for example. Upload the file. Works.

scenario two
============
login as support, start a FTP client connecting to remote FTP server. Use the same credentials as scenario #1, upload the file. Failed. error is
local: autobackup remote: autobackup
local: autobackup: Permission denied


So, the difference lies on the local, not remote side. Agree?

johnifanx98 02-29-2012 04:13 PM

Quote:

Originally Posted by johnifanx98 (Post 4615345)
Let me clarify this more.

scenario one
============
login as root, start a FTP client connecting to remote FTP server. The credentials for FTP are upload/password for example. Upload the file. Works.

scenario two
============
login as support, start a FTP client connecting to remote FTP server. Use the same credentials as scenario #1, upload the file. Failed. error is
local: autobackup remote: autobackup
local: autobackup: Permission denied


So, the difference lies on the local, not remote side. Agree?

issue resolved. It turns out after adding user support to the same group of the file, I have to log into another session to make it take effect actually....


All times are GMT -5. The time now is 11:54 AM.