SlackwareThis Forum is for the discussion of Slackware Linux.
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.
I am fairly new to Slackware and just about have it set up the way that I want it. My biggest problem is setting permissions so that I can run programs as user and not root. Can someone help me. I would be very grateful. :-) For instance, I installed GtKam and K3b from source. I can run both of these from root however I can't get them working when I log in as user. Thanks!
Perhaps you don't have the path they were installed in in your $PATH? I'm not familiar with these programs but perhaps you could tell us an error message when you try running them? If it says no such command then it probably isn't in your path. You can either make a symbolic link to the program in one of the directories in your path, or add the directory to your path. If you need help with this let me know.
1. You may not be installing these programs correctly. After you have compiled them, did you run "make install" to copy them to their proper locations, or are you running them in the same directory you compiled them in?
2. If all you really need to do is change the permissions, the command "chmod 755 $program" should do it (replace $program with the name (including the full path) of the program you want to run). Run this command as root.
An explanation of option 2 (you don't need to read this unless you want to know how it works):
Chmod is the Linux program for setting file permissions. If you look at a file with ls -l, you can see what its permissions are set at. For example:
root@boxofrain:~# ls -l testfile
-rw-r--r-- 1 root wheel 0 Apr 11 20:00 testfile
What you're interested in is the thing with all of the dashes in it. The first dash tells you what you are looking at, such as a file or a system device. You can usually ignore this. The next three characters "rw-" give the permissions the file's OWNER (root, in this case) has on the file. The first character in that group will either be an r or a dash, with an r meaning the owner has read permission and a dash meaning the owner does not have read permission. The next character will be either a w (has write permission) or a - (does not have write permission). The last character in this group of three will be either an x (can execute the file as if it were a program) or a - (no execute permission). So, in the example above, the file's owner, root, can read and write the file, but not run it as a program. The next group of three characters after root's permissions indicates the permissions member's of root's group (in this case, sys, as shown above) have on the file. It uses the same system as described above, so members of the "sys" group have read permission, but can't write to or execute the file. The last group of three indicates the permissions everyone else (users who aren't root and aren't in the sys group) have on the file, again, using the same rwx system. So they can also read, but not write or execute.
With chmod, you can either set the permissions by letters (u = owner, g = owner's group, o = other users, + = add permissions - = remove permissions, r = read w = write x = execute) or by numbers. Some examples with letters
"chmod u+x testfile" = "Give the testfile's owner permission to execute the file"
"chmod ug+rw testfile" "Give the testfile's owner, and all members of the owner's group, permission to read and write to the file"
"chmod o-rwx testfile" = "Don't give users who are not testfile's owner or members of the owner's group permission to read write or execute the file, and take away these permissions on the file if they already have them"
"chmod g-w testfile" = "Don't give members of the owner's group permission to write to testfile, and take away the permission if they already have it"
Chmod can also be used with numbers, as I did above giving you the number 755. Each digit in the number corresponds to one group of three from the output of ls -R above, so the first digit is for the file's owner, the second is for the file's owner's group, and the third is for all other users. To calculate the value of each digit, start with 0, add 4 if the user should have read permission, add 2 if the user should have write permission, and add 1 if the user should be allowed to execute the file. For example, since we want the file's owner to be able to read, write, and execute the file, 4+2+1=7, so the first digit is 7. We want the file's owner's group to be able to read and execute the file, but not write to it, so 4+1=5, and the second digit is 5. We want the rest of the users to also be able to read and execute the file without writing, so again, 4+1=5. So our end result is "chmod 755 testfile".
Let's have a look and see if that works:
First, we create a file testfile to test this on:
root@boxofrain:~# touch testfile
Now, we have a look at the permissions on testfile:
root@boxofrain:~# ls -l testfile
-rw-r--r-- 1 root sys 0 Apr 11 20:14 testfile
As you can see, root can read and write to the file, and members of root's group (sys) and all other users on the system can only read it.
Let's try changing the permissions:
root@boxofrain:~# chmod 755 testfile
And have a look to see if it worked:
root@boxofrain:~# ls -l testfile
-rwxr-xr-x 1 root sys 0 Apr 11 20:14 testfile
Yup! It worked! Isn't chmod a wonderful command?
I installed both K3b and gtkam with ./configure --prefix=/usr, make, su, make install
I have installed several packages and am not new to linux and am fairly familiar with chmod.
My problem is that with K3b I can get it running as a user. I can burn mp3's and copy files but I can't copy a cd. I don't have the permission to use the cd as user. I get a message saying that it can't open the device. However, if I run it as root I can burn cd's.
Same with gtkam. I can get it up and running but I can't access my camera as user. I have to log in as root to be able to access my camera and get the photos.
Does this make sense? I have used several other distros and haven't had issues. I have wanted to use Slackware for some time. I really like the distro but I've run into a couple of snags. Thanks for your help.
First of all, Imagreg, I apologize if my instructions were too newbified. I didn't mean to be insulting, it's just that with such a wide variety of experience levels here it's sometimes hard to tell what level somebody is at just from a short post. Secondly, I also apologize for misunderstanding your question.
It sounds like your problem is with permissions on the files under /dev that represent your devices. Those are the files to change the permissions on. I don't know what they are on your system, but the CD drive is probably /dev/hd<something> or /dev/sd<something>.
I can help with GTKAM, Gphoto2 permissions. Do the following...
as root type the following
vi /etc/hotplug/usb/usbcam
erase everything in it (back it up if you don't trust me)
and put the following lines in...
(by the way, if there was nothing in the file, just type the following and save it)
if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
then
chmod a+rwx ${DEVICE}
fi
That should do it. Now, plug your camera in, then turn it on. Hotplug will detect it and look to this file to see what to do with it. Start gtkam or digikam or flphoto and it should work fine as a user now.
it's not saying that you are nebwified is the reason that distros like suse, mandrake, redhat and things like that, that you already had use maybe for several years are different that the way slack manage, those others distros are friendly like, had the supermount activated in the kernel options, had cute graphical configuration methods, have several cute things that does almost every configuration for the user. Let's talk about slack... slackware is not friendly, slack doesn't bring supermount stuff, slack doesn't have cute graphical tools for you configure anything. Put it this way, slack is not a pain, but had is method when you use slack, don't compare it too mandrake or redhat think you are using BSD or Solaris. if you want to configure him you had to work whit commands line and config files manually. to let slack mount and umount the cdrom or floppy drive as a non root user, you could edit sudo, edit /etc/groups or the easy way edit /etc/fstab and add the line user, under the line that points to your cdrom, floppy and probably your usb camera is under there too. i should you a example of my fstab file and now i could mount and umount my devices whit out been root.
Thanks for the suggestion little_ball but I have already done these. I can open the cd and floppy just fine as user. Thats not the problem. My problem is that I can't copy a music cd as user for some reason. I can burn files and iso's but I can't copy a music cd or rip songs from a cd. I have tried just about everything.
This is the Debugging Output that I get:
K3b Version: 0.11.2
KDE Version: 3.2.1
QT Version: 3.3.1
Originally posted by imagreg Thanks for the suggestion little_ball but I have already done these. I can open the cd and floppy just fine as user. Thats not the problem. My problem is that I can't copy a music cd as user for some reason. I can burn files and iso's but I can't copy a music cd or rip songs from a cd. I have tried just about everything.
Try adding yourself to the 'disk' group... maybe it'll work. If it doesn't... then there is one other thing... if you start k3b as root (you'll probably be able to rip it as root) from an xterm you would probable see something like
Checking /dev/cdrom for cdrom...
Testing /dev/cdrom for cooked ioctl() interface
/dev/scd0 is not a cooked ioctl CDROM.
Testing /dev/cdrom for SCSI interface
generic device: /dev/sg0
ioctl device: /dev/scd0
change the permissions on that sg0 device (chmod 666 /dev/sg0) and you'll be able to rip from k3b as a normal user.
Last edited by Marsanghas; 04-29-2004 at 04:15 AM.
I think the cdrom is fine I think what I need are the correct permissions for cdrecord. I think this is where my problem lies. I can burn music cds fine under root but can't as user so I am thinking this is the problem. I tried chmod 666 cdrecord but this didn't work. Any suggestions? Thanks.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.