LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 07-24-2004, 10:45 PM   #1
kiwidoc
LQ Newbie
 
Registered: Jul 2004
Distribution: Mandrake 10.0
Posts: 3

Rep: Reputation: 0
using chmod to change file permission


I'm using Mandrake 10 with KDE as the GUI. I want to allow all users to run hcfpciconfig, so change to su and run chmod and get the following output

[root@localhost sbin]# chmod +x hcfpciconfig -v
mode of `hcfpciconfig' changed to 0555 (r-xr-xr-x)
I then run ls and get
[root@localhost sbin]# ls -l hcfpciconfig
-r-xr-xr-x 1 root root 52699 Jul 16 03:32 hcfpciconfig*
which I think means that all users should be able to execute hcfpciconfig

But if I change back to an ordinary user, I get
[david@localhost sbin]$ ls -v hcfpciconfig
hcfpciconfig*
and can't run hcfpciconfig unless I change to su again...

What am I doing wrong...?
 
Old 07-24-2004, 10:55 PM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 376Reputation: 376Reputation: 376Reputation: 376
Re: using chmod to change file permission

Quote:
Originally posted by kiwidoc

[david@localhost sbin]$ ls -v hcfpciconfig
hcfpciconfig*
what are you doing there??? why not use "-l" to see the permissions??

do you get some kinda error when you try to run the prog as a normal user??

are you specifying the path to it when running it as a normal user???

you should have to, as /usr/sbin shouldn't be in your normal user's path...

if you're gonna execute it as a normal user from the current directory without having it in your path you need to do a "./" before the executable, for example ./hcfpciconfig


Last edited by win32sux; 07-24-2004 at 11:00 PM.
 
Old 07-25-2004, 06:51 AM   #3
kiwidoc
LQ Newbie
 
Registered: Jul 2004
Distribution: Mandrake 10.0
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks - I need to run hcfpciconfig to avoid a "modem is busy' error when using kppp. The /usr/sbin directory is where the package installed to. Ive tried running it from the directory and by ./hcfpciconfig, still require to login as root to run it.
 
Old 07-25-2004, 07:39 AM   #4
max_sipos
Member
 
Registered: Jul 2004
Posts: 96

Rep: Reputation: 15
If it still doesn't work with the executable flag set for all users, then it probably needs root privileges to run. You need to set the setuid flag, I think it's chmod o+x . This will tell the system to start the program as if root started it. Do note that this is a security risk.

--

Maksim Sipos
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Why chmod cannot change symbolic link permission? mikeshn Linux - General 17 03-22-2012 08:08 PM
chmod won't change the file permissions midtown266 Linux - Newbie 12 11-28-2004 08:46 PM
chmod permission change? tidasu Linux - Newbie 7 08-30-2004 07:02 PM
chmod 755 won't change file permission. duffboygrim Linux - General 11 04-29-2004 07:17 PM
Cannot Change File Permission dsuratman Linux - Newbie 12 11-03-2003 02:47 PM


All times are GMT -5. The time now is 10:13 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration