LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   permissions (https://www.linuxquestions.org/questions/linux-newbie-8/permissions-383004/)

space_invader64 11-14-2005 07:53 AM

permissions
 
I am running mandrake official 10.1. I would like my regular login to have access to everything. There is a lot of stuff that I don't get access to. How can I do that?

tangle 11-14-2005 08:21 AM

Do you mean you want you regular user to have root privileges or do you just want to be able to read files?

space_invader64 11-14-2005 08:34 AM

Yes I want the regular user to have root privileges.

reddazz 11-14-2005 08:41 AM

You need to switch to root using the su command from the terminal whilst logged in as a normal user. You can also use sudo to give yourself permissions to run certain commands normally accessible only as root. Its a big security risk to give a normal user all of roots privileges (look at what happens to Windows machines that run as administrator by default).

prabuayyappan 11-14-2005 08:49 AM

set the uid in
/etc/passwd as 0

for example
pp:x:508:508::/home/pp:/bin/bash ==> older one

change it to as follow
pp:x:0:0::/home/pp:/bin/bash

tangle 11-14-2005 08:52 AM

As reddazz said, it is dangerous to. I would suggest using the su command. But, if you want to do it, prabuayyappan example will get you there.

sundialsvcs 11-14-2005 12:32 PM

Sooner or sooner, you will sorely regret that decision.

You see, sooner or sooner, some little flea-bag Java script or somesuch is going to wander through, hidden on some web-page somewhere, and it will find all of the doors and windows of your computer system completely unlocked. And it will move in. Maybe it will just trash the place and get it over with, but more likely it will hide. And the person who placed it there will now have unlimited use of your computer. And bad things will happen.

No, you do not want your "regular login" to have unrestricted use of "your" computer. You want your regular login to be, in every way, "Just An Ordinary Joe." You want the users on the machine to be as un-privileged as possible. Why? For the same reason that you want to keep the safety on a gun turned on.

I can't help the fact that Microsoft continues to ship Windows boxes to unsuspecting customers with all login-passwords turned "off" and full Administrative rights. In the olden days when no one connected to the Internet that might have been "marginally okay," but in today's environment when everyone is connected to the Internet, constantly and at high speed, it is not. Those security features are there for your protection. Use them.

Quote:

Hacker in Outer Mongolia: "Computer, translate every file in the /home directory to EBCDIC."
Your computer: "Yes, m'lord." "It is done, m'lord."
HIOM: "Now transmit all the buisness records to that nice man in Zimbabwe who has won billions of dollars in the Zimbabwe Lottery, so that he can send a fortune to us."
YC: "Yes, master." "It is done."
HIOM: "Now format the hard drive and set the CPU temperature to 'broil.'"
YC: "Yes, master." "It w..." (bzzzzt....)
If you foolishly turn your security off, then your computer will obey without question anything that you, or anyone else who can reach your machine from anywhere in the world, may ask it to do. And, like I said, you will sorely regret that.

Hallowedpoint 01-07-2006 03:17 AM

same problem
 
I have the same annoyances as space invader, but I don't want to give my normal login root privilages. I'm having trouble changing privilages for files. Let me explain: I have a second internal HD in my computer that is only used for storing my mp3 files that I've ripped from my cd's. My wife's mp3's are also stored there so as not to take up room on her laptop, and I've networked the drive so she can access them. But I can't give her permission to change any of the information (like the ID3v2 tags) for the files, and I can't change them from my normal login (it says that they are read only in both instances). So I log in as root, and change the permissions using right-click>properties and set it change for all subfolders as well. That doesn't work... they immediately change back to just read and execute. So I went into the terminal and used chmod to change them again... and again, it doesn't work. Is there any way for me to set the permissions for the entire second harddrive to rwx for everyone (since there's nothing but music on it) so my wife can change her tags and I won't have to log in as root to do it? thanks...

pixellany 01-07-2006 11:45 AM

Quote:

Originally Posted by space_invader64
Yes I want the regular user to have root privileges.

REALLY REALLY REALLY BAD IDEA---DANGER DANGER

How much effort is it to type "su" plus a password??

Linux has enormous power and flexibility at the command line---that translates unfortunately to the power to screw things up. Why do you want to try going thru you daily routine while juggling a running chainsaw?

slackhack 01-07-2006 12:51 PM

Quote:

Originally Posted by Hallowedpoint
I have the same annoyances as space invader, but I don't want to give my normal login root privilages. I'm having trouble changing privilages for files. Let me explain: I have a second internal HD in my computer that is only used for storing my mp3 files that I've ripped from my cd's. My wife's mp3's are also stored there so as not to take up room on her laptop, and I've networked the drive so she can access them. But I can't give her permission to change any of the information (like the ID3v2 tags) for the files, and I can't change them from my normal login (it says that they are read only in both instances). So I log in as root, and change the permissions using right-click>properties and set it change for all subfolders as well. That doesn't work... they immediately change back to just read and execute. So I went into the terminal and used chmod to change them again... and again, it doesn't work. Is there any way for me to set the permissions for the entire second harddrive to rwx for everyone (since there's nothing but music on it) so my wife can change her tags and I won't have to log in as root to do it? thanks...

if you're sharing over nfs and you're sure you really want to do that, chmod the entire directory and contents to 777:

# chmod 777 <dir> -R

it would be better to make a group (mp3, for example) and put your wife and you in the group. then chown the directory and files to either you or your wife and the group, and then give write permissions to the group, something like this:

# groupadd mp3
[add user names to newly made mp3 group in /etc/group]
# chown user:mp3 <dir> -R
# chmod 775 <dir> -R

if you're sharing over samba, the above alone *might* work, but i think it could also depend on other variables in your smb.conf file. in that case, you'd want to post the samba info and more specific information about the directories with the mp3s, i.e., owner, group, drwxrwxrwx info, etc. it just makes it easier to see what's going on when the info is more specific.

Hallowedpoint 01-07-2006 05:51 PM

I've tried chmod on the directory, both chmod 777 and chmod a+rwx, and it just didn't work for some reason. In terminal, it went to the next line after I ran the command exactly as it would it it had changed the permissions, but I viewed them, and they still didn't allow write access. Does the -R have a major significance? I don't know what that means, because it wasn't in the little tutorial of bash commands that I found and have been using to teach myself. Being an almost total n00b to the OS, I'm still trying to figure out how to do what I want/need to do. Where would I find the Samba info to post it? This might also lead to a solution to a networking problem I posted about in another thread (I can't see any shared files that are on my wife's XP laptop or the other XP machine we have running, even tho the music files can be viewed/played on both computers). If I can figure out where to find things and how to edit stuff in the shell better on Linux then I probably won't have nearly as many difficulties.

gilead 01-07-2006 06:15 PM

Try typing `man chmod` without the quotes. The -R means recursive so that everything below the target also gets the permissions applied. Since the pitfalls of no security have already been pointed out...

Are you using this command on a writable file system? If you type `mount` and look for the top level of the filesystem you're working in does it say rw? For example, if you're working in /usr/somedir is there a line in the mount output for /usr that says rw? If it says ro that will prevent the changes. Here are a couple of my mount outputs:

Changes can be made under this directory:
Code:

/dev/hda7 on /var type ext3 (rw)
Changes can't be made under this directory:
Code:

/dev/hda5 on /boot type ext3 (ro)

Hallowedpoint 01-07-2006 09:17 PM

OK, recursive... makes more sense now, thanks!! =) I typed mount, and for the harddrive I'm trying to work with (which isn't the one any system files are on, only music) I get: "/dev/hdb1 on /windows/D type vfat (rw,noexec,nosuid,nodev,gid=100,umask=0002,utf8=true)". I understand the part that it's writable thanks to gilead, but am clueless as to the rest of the message. Here's what shows up for the harddrive that my system files and everything else are on, for comparison: "/dev/hda2 on / type reiserfs (rw,acl,user_xattr)".

gilead 01-07-2006 10:25 PM

It's the vfat file system that's causing the problem. vfat doesn't store file permissions the way the the Linux files ystems do. You've mounted it with a gid of 100 - are you both in the group that gid 100 corresponds to? In other words, if you run:

Code:

grep ':100:' /etc/group
are both of your usernames returned in the output?

Hallowedpoint 01-08-2006 01:07 AM

I ran exactly what you said and this was the output: "users:x:100:" My wife doesn't have a username because she doesn't use this computer. She uses her laptop that runs XP (which puts her in the group 'nobody' through Samba, I believe). And I don't recall mounting it myself... I think it might have been done sutomatically by Linux when I installed?? Not sure. But, it didn't even return my username for it... unless I was supposed to put somthing else in place of '/etc/group'?? Is there any way to change the file system without reformatting the harddrive? Or will I have to move everything out of it, reformat it, and move everything back in? This would be simple for me to do since I have another internal harddrive if that would be the easiest thing. If that's the case, how would I go about reformatting it? And one last pointless question: Is the vfat file system a result of where this used to be a windows machine and I didn't touch the second HD when I switched to linux?


All times are GMT -5. The time now is 04:30 AM.