LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-15-2008, 07:16 PM   #1
Rollo69
Member
 
Registered: Sep 2005
Location: Charlotte, NC
Distribution: Slack 12.0
Posts: 190

Rep: Reputation: 30
Question command problems for user


Can someone help me get slocate to work for user. I have tried following other peoples advise (google, forums) but still no go.
Code:
ls -ld /var/ /var/lib
drwxr-xr-x  18 root root 488 2005-09-12 02:01 /var/
drwxr-xr-x  15 root root 368 2005-09-12 01:56 /var/lib

ls -l /var/lib/slocate
total 7271
-rw-r-----  1 root slocate 3720271 2008-02-15 07:27 slocate.db
-rw-r-----  1 root root    3714733 2008-02-13 09:08 slocate.db.old

ls -l /usr/bin/slocate
-rwxr-xr-x  1 root root 26652 2004-05-29 23:52 /usr/bin/slocate
I also can't get the following commands to work for user.
Code:
hdparm -i hda
-bash: hdparm: command not found

 lspci
-bash: lspci: command not found

ifconfig
-bash: ifconfig: command not found
I'm almost sure I've used these before as user. I saw in another post on this forum (not slackware) that these commands are for root only. If that's true then let me know.

Thanks
 
Old 02-15-2008, 07:59 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
On my system, ls -l /usr/bin/slocate gives:
Code:
-rwxr-sr-x 1 root slocate 31112 2006-04-19 14:56 /usr/bin/slocate
You could alter yours with sudo chmod g+s /usr/bin/slocate

The other commands (/usr/sbin/hdparm /sbin/lspci and /sbin/ifconfig) can be run by non-root users, but settings cannot be changed except with root access (sudo, su or login as root). /usr/sbin and /sbin won't be on your path as a non-root user, just use the full path to the command.
 
Old 02-15-2008, 08:10 PM   #3
Rollo69
Member
 
Registered: Sep 2005
Location: Charlotte, NC
Distribution: Slack 12.0
Posts: 190

Original Poster
Rep: Reputation: 30
Thanks for you quick response and help gilead.

Quote:
Originally Posted by gilead View Post
On my system, ls -l /usr/bin/slocate gives:
Code:
-rwxr-sr-x 1 root slocate 31112 2006-04-19 14:56 /usr/bin/slocate
Here's after chmod g+s

Code:
bigdawg@Heavnersnetwork:~$ ls -l /usr/bin/slocate
-rwxr-sr-x  1 root root 26652 2004-05-29 23:52 /usr/bin/slocate*

bigdawg@Heavnersnetwork:~$ slocate etc
warning: slocate: could not open database: /var/lib/slocate/slocate.db: Permission denied
I don't understand it.

Thanks

edit: I don't know if it makes a difference but I noticed my /usr/bin/slocate has an * after it and your's doesn't.??

Last edited by Rollo69; 02-15-2008 at 08:13 PM.
 
Old 02-15-2008, 08:25 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Sorry, I didn't look closely at the ownership. Since your copy shows it being owned by root, you'll also need:
Code:
chgrp slocate /usr/bin/slocate
I'm assuming there's a group called slocate on your system and that you have the same output as this:
Code:
$ ls -ld /var/lib/slocate
drwxr-x--- 2 root slocate 4096 2008-02-16 00:37 /var/lib/slocate
~$ sudo ls -l /var/lib/slocate
-rw-r----- 1 root slocate 7058201 2008-02-16 00:37 slocate.db
 
Old 02-15-2008, 08:52 PM   #5
Rollo69
Member
 
Registered: Sep 2005
Location: Charlotte, NC
Distribution: Slack 12.0
Posts: 190

Original Poster
Rep: Reputation: 30
User can't slocate

Thanks for the help gilead.

Code:
bigdawg@Heavnersnetwork:~$ sudo chgrp slocate /usr/bin/slocate
Password:
bigdawg@Heavnersnetwork:~$ ls -l /usr/bin/slocate
-rwxr-xr-x  1 root slocate 26652 2004-05-29 23:52 /usr/bin/slocate*

bigdawg@Heavnersnetwork:~$ slocate slocate
warning: slocate: could not open database: /var/lib/slocate/slocate.db: Permission denied

bigdawg@Heavnersnetwork:~$ ls -ld /var/lib/slocate
drwxr-xr-x  2 root slocate 112 2008-02-15 07:27 /var/lib/slocate/

bigdawg@Heavnersnetwork:~$ sudo ls -l /var/lib/slocate
total 7271
-rw-r-----  1 root slocate 3720271 2008-02-15 07:27 slocate.db
-rw-r-----  1 root root    3714733 2008-02-13 09:08 slocate.db.old
Do you see anything wrong with my permissions/groups.?? There isn't supposed to be anything set (i.e. SUID) is there. I did just notice that the permissions are different on my /usr/bin/slocate. It's no longer set. I'll give the chmod command another try.

edit:
Code:
sudo chmod g+s /usr/bin/slocate
Password:

bigdawg@Heavnersnetwork:~$ ls -l /usr/bin/slocate
-rwxr-sr-x  1 root slocate 26652 2004-05-29 23:52 /usr/bin/slocate*
It's now working... I had it working yesterday but when I booted up today it wasn't working. Is there anything that could be changing the permissions inadvertantly or otherwise??

Thanks for you help gilead!!

Last edited by Rollo69; 02-15-2008 at 08:57 PM. Reason: adding new code
 
Old 02-15-2008, 11:19 PM   #6
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Quote:
Originally Posted by Rollo69 View Post
It's now working... I had it working yesterday but when I booted up today it wasn't working. Is there anything that could be changing the permissions inadvertantly or otherwise??
There shouldn't be - I ran the following on my system to look for scripts, config files, etc. that affect slocate and didn't get anything that changed permissions (nothing relevant was returned):
Code:
# grep -ir slocate /etc/*
# grep -ir slocate /var/spool/cron/*
 
Old 02-16-2008, 06:21 PM   #7
Rollo69
Member
 
Registered: Sep 2005
Location: Charlotte, NC
Distribution: Slack 12.0
Posts: 190

Original Poster
Rep: Reputation: 30
Thanks gilead.. I have booted up now and slocate is still working. I appreciate your help as well as this forum.

Thanks to you and to all who help us!!!
 
  


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
Su command - only one user mariusek Linux - Newbie 8 05-05-2007 04:22 AM
run a command as another user!! mike81 Linux - Newbie 7 08-02-2006 12:58 PM
user can use command.. bruse Mandriva 2 04-12-2005 07:21 AM
what is the command to make a user change their password after creating a new user? naweenio Linux - Newbie 7 01-05-2005 07:07 AM
Execute a command as another user mpgram Linux - Newbie 6 06-08-2004 11:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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