LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-29-2012, 11:44 AM   #1
johnifanx98
LQ Newbie
 
Registered: Jan 2008
Posts: 26

Rep: Reputation: 0
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?
 
Old 02-29-2012, 11:56 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,935

Rep: Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692
Quote:
Originally Posted by johnifanx98 View Post
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.
 
Old 02-29-2012, 01:22 PM   #3
johnifanx98
LQ Newbie
 
Registered: Jan 2008
Posts: 26

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
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.

Last edited by johnifanx98; 02-29-2012 at 01:26 PM.
 
Old 02-29-2012, 01:45 PM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,935

Rep: Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692
Quote:
Originally Posted by johnifanx98 View Post
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???
 
Old 02-29-2012, 01:58 PM   #5
johnifanx98
LQ Newbie
 
Registered: Jan 2008
Posts: 26

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
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...

Last edited by johnifanx98; 02-29-2012 at 02:49 PM.
 
Old 02-29-2012, 03:34 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,935

Rep: Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692Reputation: 3692
Quote:
Originally Posted by johnifanx98 View Post
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.
 
Old 02-29-2012, 03:49 PM   #7
johnifanx98
LQ Newbie
 
Registered: Jan 2008
Posts: 26

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
...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?
 
Old 02-29-2012, 05:13 PM   #8
johnifanx98
LQ Newbie
 
Registered: Jan 2008
Posts: 26

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by johnifanx98 View Post
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....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] CSH Permission Denied When Accessing Local File wafflesausage Programming 15 03-10-2011 03:26 PM
permission denied, uploading to folder /etc/php.ini notiq Linux - Newbie 3 09-13-2007 06:34 AM
Root gets permission denied on rw local filesystem sfc Linux - Software 0 02-17-2006 12:17 PM
Uploading files using PHP giving Permission Denied error MatthewG Programming 4 05-27-2004 04:38 PM
CVS local repository - permission denied gandalf2041 Linux - Software 0 03-19-2004 03:19 PM


All times are GMT -5. The time now is 12:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration