LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 10-08-2003, 04:16 AM   #1
gh0ul
LQ Newbie
 
Registered: Sep 2003
Location: Charleston, SC
Distribution: RedHat8.1
Posts: 13

Rep: Reputation: 0
save to disk as normal user


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
 
Old 10-08-2003, 05:34 AM   #2
zebbedi
LQ Newbie
 
Registered: Mar 2003
Distribution: Gentoo
Posts: 18

Rep: Reputation: 0
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.
 
Old 10-08-2003, 06:30 AM   #3
gh0ul
LQ Newbie
 
Registered: Sep 2003
Location: Charleston, SC
Distribution: RedHat8.1
Posts: 13

Original Poster
Rep: Reputation: 0
I'm trying to save files to a sub-dir off of my Home dir, /home/downloads/target_dir

??

Can this not be done in Linux?
 
Old 10-08-2003, 06:53 AM   #4
gh0ul
LQ Newbie
 
Registered: Sep 2003
Location: Charleston, SC
Distribution: RedHat8.1
Posts: 13

Original Poster
Rep: Reputation: 0
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.
 
Old 10-08-2003, 07:27 AM   #5
aaa
LQ Guru
 
Registered: Jul 2003
Location: VA
Distribution: Slack 10.1
Posts: 2,194

Rep: Reputation: 47
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-

4+2+1 4+2+1 4+2+1=777
r+w+x r+w+x r+w+x=rwxrwxrwx

Last edited by aaa; 10-08-2003 at 07:29 AM.
 
Old 10-08-2003, 08:08 AM   #6
gh0ul
LQ Newbie
 
Registered: Sep 2003
Location: Charleston, SC
Distribution: RedHat8.1
Posts: 13

Original Poster
Rep: Reputation: 0
aaa: Thank you so much for the very descriptive, and correct response. I knew there had to be a way to do it.
 
Old 10-08-2003, 08:34 AM   #7
yapp
Member
 
Registered: Apr 2003
Location: Netherlands
Distribution: SuSE (before: Gentoo, Slackware)
Posts: 613

Rep: Reputation: 30
just don't chmod everything to 777

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
 
  


Reply



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
Running super user commands as normal user mickyg Linux - Security 5 10-14-2005 07:25 PM
Force save to disk Wynand1 Programming 3 01-28-2005 01:53 AM
Games runs slow as normal user, but fast as root user mcore Linux - Software 2 06-07-2004 11:11 PM
Cant read/write to second hard disk under normal user Nukem Linux - General 8 01-28-2004 07:03 AM
normal user = super user jayakrishnan Linux - General 4 03-19-2002 09:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:04 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
Open Source Consulting | Domain Registration