Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Permission Setting Help [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
neogen
Apprentice
Apprentice


Joined: 10 Oct 2004
Posts: 163

PostPosted: Mon Oct 11, 2004 10:00 pm    Post subject: Permission Setting Help [solved] Reply with quote

hi everyone, just finally got my gentoo system up and running, but now i've run into another problem, when i am in root i am able to create file and directory fine, but when i log on as user, i cannot create folder or file. It says Permission Denied.

As you can see I am a noobie at this linux stuff, please help me out, and show me how to change the permission setting, i dont want to explore the setting becuz im afraid i might mess up the system.


Last edited by neogen on Mon Oct 18, 2004 5:33 am; edited 1 time in total
Back to top
View user's profile Send private message
fennec
l33t
l33t


Joined: 30 Aug 2003
Posts: 613
Location: Montreal

PostPosted: Mon Oct 11, 2004 10:01 pm    Post subject: Reply with quote

where are you trying to create files when you are logged in as a normal user ?
Back to top
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Mon Oct 11, 2004 10:30 pm    Post subject: Reply with quote

Ugh, please could you not post in pink next time? It's pretty hard on the eyes! :P

Anyway, where are you trying to create files? If they're in your home directory, then it may just be that you don't have write permissions to /home/<username>. If that's the case, try this command as root:
Code:
chown -R <username>:users /home/<username>

(Obviously replacing <username> with what yours actually is. :wink:

If you're trying to create files outside your home directory, then that's what I'd expect. About the only place outside their home where a user should be able to make files is in /tmp.
_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
neogen
Apprentice
Apprentice


Joined: 10 Oct 2004
Posts: 163

PostPosted: Mon Oct 11, 2004 10:46 pm    Post subject: Reply with quote

ahah sorry about the pink font, i was trying to make it purple, anyhow, yes i am trying to create files and folder in my home directory, when login on as a normal user and not as root.
Back to top
View user's profile Send private message
neogen
Apprentice
Apprentice


Joined: 10 Oct 2004
Posts: 163

PostPosted: Mon Oct 11, 2004 10:51 pm    Post subject: Reply with quote

Quote:
Anyway, where are you trying to create files? If they're in your home directory, then it may just be that you don't have write permissions to /home/<username>. If that's the case, try this command as root:
Code:
chown -R <username>:users /home/<username>
[/qoute]

i try that command as root user, and the output of that command is:

chown: cannot access '/<myusername>': No such file or directory
Back to top
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Mon Oct 11, 2004 10:52 pm    Post subject: Reply with quote

Ok, does your home directory actually exist? What is in the /home directory?
_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
neogen
Apprentice
Apprentice


Joined: 10 Oct 2004
Posts: 163

PostPosted: Mon Oct 11, 2004 10:56 pm    Post subject: Reply with quote

ahaha stupid me, i used ur command, Maedhros, and it's working now, instead of the chown -R <username>:users /home/<username>

i just did chown -R <username>:users /


well its working now thanks guys for the help
Back to top
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Mon Oct 11, 2004 11:01 pm    Post subject: Reply with quote

Erm.... Oh dear... 8O

There are large parts of the filesystem that should be owned by root, and some that should be owned by different users. Only your home directory should be owned by your user....
_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
neogen
Apprentice
Apprentice


Joined: 10 Oct 2004
Posts: 163

PostPosted: Mon Oct 11, 2004 11:03 pm    Post subject: NOOBIEST QUESTION EVER!! Reply with quote

hi its me again, i know i've posted some of the most newbiest question, but hey i learn rite, anyhow

i wanna be able to compile c program in gentoo and run the output.

i use the command, cc hello.c and gcc hello.c, i get it to compile, and it gave me an output file called a.out.

now im wondering how do i execute a.out or another command to get by program to output something on screen?
Back to top
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Mon Oct 11, 2004 11:05 pm    Post subject: Reply with quote

This should probably be in a new thread. :wink:

Anyway, change the permission on the a.out file to executable (chmod +x a.out), then run it like so: ./a.out.
_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
neogen
Apprentice
Apprentice


Joined: 10 Oct 2004
Posts: 163

PostPosted: Mon Oct 11, 2004 11:05 pm    Post subject: Reply with quote

Quote:
Erm.... Oh dear... Shocked

There are large parts of the filesystem that should be owned by root, and some that should be owned by different users. Only your home directory should be owned by your user....


would that cause me problem later on??, becuz i stall according to the handbook instruction and that was what i end up with.[/quote]
Back to top
View user's profile Send private message
neogen
Apprentice
Apprentice


Joined: 10 Oct 2004
Posts: 163

PostPosted: Mon Oct 11, 2004 11:09 pm    Post subject: Reply with quote

also if it is dangerous to have that much access, how to i change it so that in normal user mode i only get to access the home directory?
Back to top
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Mon Oct 11, 2004 11:15 pm    Post subject: Reply with quote

I don't know how to repair it really - the permissions are carefully set up by everything that gets installed, and the only way I can think of is to start again. The user owning everything is as bad as running the system as root - but worse because some programmes won't be able to function properly. They're expecting to find the files they control, but they can't access them because your user is the owner now, not the user that they're running as.

I suspect you didn't have a home directory because you missed the -m option to useradd, when creating your user.
_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
neogen
Apprentice
Apprentice


Joined: 10 Oct 2004
Posts: 163

PostPosted: Mon Oct 11, 2004 11:19 pm    Post subject: Reply with quote

Quote:
I suspect you didn't have a home directory because you missed the -m option to useradd, when creating your user.



you are definately rite, i did add user but didnt put the -m, due to the fact that i have no idea what that does, also since that u mention it now, do u by any chance know how to remove a user?, and also if i remove the user would that affect the access permission that i've set earlier for my neogen account? and would it affect my root at all?
Back to top
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Mon Oct 11, 2004 11:24 pm    Post subject: Reply with quote

No, removing the user wouldn't do anything much at this stage (except to possibly make the system even more unusable?!). For next time though, userdel will delete users. The -m option to useradd creates a users home directory when it creates the user.

You couldn't write anything, because in the absence of a home directory, you were put in the / directory when you logged in - and that's one of the many bits of the system that ordinary users aren't supposed to be able to write to. :P
_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
neogen
Apprentice
Apprentice


Joined: 10 Oct 2004
Posts: 163

PostPosted: Mon Oct 11, 2004 11:27 pm    Post subject: Reply with quote

aahah well u know what, we all learn from our mistake rite, so im gonna go ahead and give that a try and if thing start acting funny, i guess im left with the option of spending another whole day installing it, since gentoo is install on my old pentium-mmx 266Mhz computer, which is a pain by the way when installing, but fun somewhat
Back to top
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Mon Oct 11, 2004 11:29 pm    Post subject: Reply with quote

Ah well, it's all part of the fun! :D I think you'd be in the lucky few if you'd only installed Gentoo once, anyway!
_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
neogen
Apprentice
Apprentice


Joined: 10 Oct 2004
Posts: 163

PostPosted: Mon Oct 11, 2004 11:32 pm    Post subject: Reply with quote

ahaha :D actually that is incorrect, this would be my 7th time installing gentoo in 4 days, i know huh, but i dont mind, its fun, i learn alot about linux, and plus if something dont work the first time, try again, its they only way to succeed.
Back to top
View user's profile Send private message
neogen
Apprentice
Apprentice


Joined: 10 Oct 2004
Posts: 163

PostPosted: Mon Oct 11, 2004 11:34 pm    Post subject: Reply with quote

big thanks to you Maedhros for all your help, i really appreciate that.
Back to top
View user's profile Send private message
neogen
Apprentice
Apprentice


Joined: 10 Oct 2004
Posts: 163

PostPosted: Tue Oct 12, 2004 2:14 am    Post subject: Reply with quote

sorry to bother again, i know i've also posted this message in another one of my post.

but is there anyway to configure the compile so that when its done compiling i can just use the command 'a.out' to execute the file instead of using the command './a.out' ?
Back to top
View user's profile Send private message
Maedhros
Bodhisattva
Bodhisattva


Joined: 14 Apr 2004
Posts: 5511
Location: Durham, UK

PostPosted: Tue Oct 12, 2004 7:22 am    Post subject: Reply with quote

You'll have to put it in one of the directories in your PATH - try echo $PATH to see which those are. If you want to create a new folder, like /home/<username>/bin to put these things in, add a line like this to your .bashrc file:
Code:
PATH=$PATH:/home/<username>/bin

Then put your files in there, make them executable, and then a.out will work.
_________________
No-one's more important than the earthworm.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum