Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
When I use Linux I usually use my normal user account. If I need to do anything that requires root privelages, then I su to root. When I browse the web, (Mozilla Firebird or Mozilla) I can't download files. The broswer, sez they are coming down, but they won't be saved to disk unless I su, then launch my browser from a shell. Does anyone know how I can get files to save from my normal account without having to lauch it from a shell? I imagine there should be some way to alter my privelages, but where?
Thanks in advance
Where are you trying to save the files to? Save them to your users home dir, and you shouldnt need to "su" unless something has gone horribly wrong with the ownership of your files.
hmmm.... that's weird... but I guess there's security reasons for it. I seem to only be able to download files to /home/UserName. Is there no way to downlload files to another dir without being root? Kinda inconvienent... If that's the only way.... I've adapted this much, keep on adapting.
Regular users aren't allowed to write to the /home directory, but can write in their /home/user directory. This is for security reasons. To change this, you change the folder's permissions or ownership. Use the 'ls -l' command to see the permissions. For example 'ls -l /home/downloads' . As root, you can change the permissions and ownership to allow others to use the folder. Changing ownership is done by the 'chown' command. Here's an example of changing the ownership from 'root' to 'someuser':
chown someuser:users /home/downloads
Now 'someuser' owns the folder. 'someuser' can also change the permissions of this folder, and basically do anything he wants with it.
'chmod' changes permissions. The /home/downloads folder probably is owned by 'root', and belongs to the 'root' group. It's permissions might be 'rw-r--r--'. The first 'rw-' is the permissions for 'root'. 'root' is allowed to Read and Write to this folder. The '-' is eXecute would be. It is blank because you can't execute folders. The second 'r--' is the permissions for whoever is in the 'root' group. Whoever is in this group is only allowed to Read this folder. The last, 'r--' is for everybody else. They are also only allowed to Read this folder. 'chmod' can change this:
chmod 666 /home/downloads
Now the permissions are 'rw-rw-rw'. Everybody is allowed to Write to the folder. The '666' is obtained by adding certain numbers, ex:
4+2+0 4+2+0 4+2+0=666
r+w+- r+w+- r+w+-=rw-rw-rw-
you can set the sticky bit (chmod +t ...), to prevent users from removing files created by other users.
for example: mkdir /downloads
chmod +w /downloads
chmod +t /downloads
or to allow certain people to write files in those folders: groupadd downloaders
* add users to the new line in /etc/group
chgrp downloads /downloads
chmod g+w /downloads
chmod o-w /downloads
* the user needs to login again before he's actually a member of the new 'downloaders' group.
last but not least; to convert the file permissions: find /downloads -type f -exec chmod 664 {} \;
find /downloads -type d -exec chmod 775 {} \;
chown -R root:downloaders /downloads
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.