LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Want To Give User Permission To Download Files From The Internet (http://www.linuxquestions.org/questions/slackware-14/want-to-give-user-permission-to-download-files-from-the-internet-4175475967/)

tb75252 09-04-2013 09:30 PM

Want To Give User Permission To Download Files From The Internet
 
I have installed Slackware 13.37 32-bit with the KDE desktop environment. I am not very experienced with Linux...

How do I give a user permission to download files from the Internet? Can it be done with KDE? (I thought that as root I would find something like "User Management" in the "System Administration" section of "System Settings" but it is not there.)

STDOUBT 09-04-2013 10:15 PM

tb75252,
Can you login as the user in question and issue the command
Code:

groups
in a terminal and tell us the output?

tb75252 09-04-2013 10:28 PM

Quote:

Originally Posted by STDOUBT (Post 5022004)
tb75252,
Can you login as the user in question and issue the command
Code:

groups
in a terminal and tell us the output?

Here we go:
Quote:

$ groups
users lp floppy audio video cdrom games plugdev power netdev scanner

STDOUBT 09-04-2013 10:37 PM

It appears there is no reason your user couldn't download files from the internet.
I don't use KDE, but what happens when you connect to the internet and attempt to
download a file? Are you using a web browser?

tb75252 09-04-2013 10:58 PM

Quote:

Originally Posted by STDOUBT (Post 5022011)
It appears there is no reason your user couldn't download files from the internet.
I don't use KDE, but what happens when you connect to the internet and attempt to
download a file? Are you using a web browser?

I am using Firefox 17.0.8 and I am attempting to download a couple of files for my Thunderbird calendar (Lightning). The files that I am trying to download are available at: http://www.mozilla.org/projects/calendar/holidays.html (I am supposed to right-click the link of the holiday calendar I want to install and select Save Link As...)

I can do the file download without problems if I log in as root. But if I log in as user (I have created only one user account), nothing happens when I do the Save Link As... action, so I figured it was a matter of assigning the user a permission to download.

STDOUBT 09-04-2013 11:53 PM

Firstly, it's not a good idea to use the GUI as root.
Secondly, your problem is certainly unusual. I'm running Firefox 21.0 because I chose
not to go along with the "upgrade" to the ESR channel. But that's beside the point.
FWIW, I have looked in about:config, and there are two references to "savelinkas" and my
values for those settings are 4000 (for the timeout) and "true" for shift.

I'm afraid I don't have an answer for you. :-(

gnashley 09-05-2013 12:31 AM

Where are you trying to save the file as user? Sounds like you are trying to save it to some area of the file system where the users don't have write priviliges.

tb75252 09-05-2013 06:01 AM

Quote:

Originally Posted by gnashley (Post 5022048)
Where are you trying to save the file as user? Sounds like you are trying to save it to some area of the file system where the users don't have write priviliges.

Firefox is set to save downloaded files in the default directory, i.e. /home/<username>/Downloads.

tronayne 09-05-2013 06:35 AM

Have you tried, logged in as the user, open Firefox, click Edit, Preferences. Select The General tab and click the box at Show the Downloads Window when downloading a file and click the circle Always as me where the save files (the default is save in Downloads)?

Too, does the Download directory exist? Open a terminal and do
Code:

ls -l
drwxr-xr-x  2 username users 4096 Dec 29  2012 Desktop/
drwxr-xr-x  2 username users 4096 May  2  2012 Documents/
drwxr-xr-x  2 username users 4096 Feb  9  2013 Downloads/
drwxr-xr-x  2 username users 4096 May  2  2012 Music/
drwxr-xr-x  2 username users 4096 May  2  2012 Pictures/
drwxr-xr-x  2 username users 4096 May  2  2012 Public/
drwxr-xr-x  2 username users 4096 May  2  2012 Templates/
drwxr-xr-x  2 username users 4096 May  2  2012 Videos/

If those directories are there (they may not all exist), they should look exactly like the above, particularly the Downloads directory. If one or more of those directories does not have the permissions as above (the drwxr-xr-x), do this
Code:

chmod 755 directory_name
Note that you do not have to save files in your home directory Downloads directory, if you chose the "Ask me" setting above, you can specify where to save a file, but, you must have permission to write to the directory where you're saving it; e.g., any user can write to /tmp but users cannot (by default) write to other user's home directories (and should not be doing that).

Hope this helps some.

tb75252 09-05-2013 10:31 PM

Quote:

Originally Posted by tronayne (Post 5022224)
Have you tried, logged in as the user, open Firefox, click Edit, Preferences. Select The General tab and click the box at Show the Downloads Window when downloading a file and click the circle Always as me where the save files (the default is save in Downloads)?

Too, does the Download directory exist? Open a terminal and do
Code:

ls -l
drwxr-xr-x  2 username users 4096 Dec 29  2012 Desktop/
drwxr-xr-x  2 username users 4096 May  2  2012 Documents/
drwxr-xr-x  2 username users 4096 Feb  9  2013 Downloads/
drwxr-xr-x  2 username users 4096 May  2  2012 Music/
drwxr-xr-x  2 username users 4096 May  2  2012 Pictures/
drwxr-xr-x  2 username users 4096 May  2  2012 Public/
drwxr-xr-x  2 username users 4096 May  2  2012 Templates/
drwxr-xr-x  2 username users 4096 May  2  2012 Videos/

If those directories are there (they may not all exist), they should look exactly like the above, particularly the Downloads directory. If one or more of those directories does not have the permissions as above (the drwxr-xr-x), do this
Code:

chmod 755 directory_name
Note that you do not have to save files in your home directory Downloads directory, if you chose the "Ask me" setting above, you can specify where to save a file, but, you must have permission to write to the directory where you're saving it; e.g., any user can write to /tmp but users cannot (by default) write to other user's home directories (and should not be doing that).

Hope this helps some.

This is what I get ("tb" is the username):
Quote:

$ ls -l
total 12
-rw-r--r-- 1 tb users 1056 Aug 8 22:02 C:\\nppdf32Log\\debuglog.txt
drwxr-xr-x 2 tb users 4096 Oct 16 2012 Desktop/
drwxr-xr-x 2 root root 4096 Mar 13 21:57 Downloads/
So it appears to me that the /home/tb/Downloads directory belongs to the "root" group instead of the "tb" one. How do I fix this problem?

tb75252 09-05-2013 11:16 PM

Quote:

Originally Posted by tb75252 (Post 5022759)
This is what I get ("tb" is the username):

So it appears to me that the /home/tb/Downloads directory belongs to the "root" group instead of the "tb" one. How do I fix this problem?

I did some research on the Internet. Here's what I did:
Quote:

# chown -R tb /home/tb/Downloads
And this is the result:
Quote:

$ ls -l
total 12
-rw-r--r-- 1 tb users 1056 Aug 8 22:02 C:\\nppdf32Log\\debuglog.txt
drwxr-xr-x 2 tb users 4096 Oct 16 2012 Desktop/
drwxr-xr-x 2 tb root 4096 Mar 13 21:57 Downloads/
I now am able to download files to /home/tb/Downloads. So, unless somebody sees a problem with what I have done or the results thereof I shall mark this thread as solved.

tronayne 09-06-2013 05:11 AM

You probably want to do this:
Code:

<log in as tb>              < log in as "you" >
su -                        < become root for a little while >
<root password>
cd /home                    < get into the /home directory >
chown -R tb.users tb        < change the owner and group of the tb directory >
<Ctrl-D or exit>            < exit from su - >

You want to avoid logging in as root as a general rule; you use su - to "become root" temporarily when necessary. Your user accounts should all be owned by the user with the group "users" unless there is some specific reason for them to be in another default group (and I can't think of any good reason for that offhand). Too, don't change the owner or group of the /home directory; it's owned by root and the group is root, be sure to leave that alone.

Looks like you got it going, though, so all is well that ends.

Hope this helps some.

tb75252 09-06-2013 05:33 AM

Quote:

Originally Posted by tronayne (Post 5022941)
You probably want to do this:
Code:

<log in as tb>              < log in as "you" >
su -                        < become root for a little while >
<root password>
cd /home                    < get into the /home directory >
chown -R tb.users tb        < change the owner and group of the tb directory >
<Ctrl-D or exit>            < exit from su - >

You want to avoid logging in as root as a general rule; you use su - to "become root" temporarily when necessary. Your user accounts should all be owned by the user with the group "users" unless there is some specific reason for them to be in another default group (and I can't think of any good reason for that offhand). Too, don't change the owner or group of the /home directory; it's owned by root and the group is root, be sure to leave that alone.

Looks like you got it going, though, so all is well that ends.

Hope this helps some.

Done! Thank you very much for the help.


All times are GMT -5. The time now is 08:31 PM.