Linux - NewbieThis 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
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.
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,646
Rep:
Quote:
Originally posted by Tinkster You have to "su -" to root, the file is in /usr/sbin
You have to read more carefully. The quote solves your problem completely. Trust Tinkster
You have two choices:
1) the program you want to start is included in your path
2) you start the program giving the full path
ad 1) Starting su with the option " -" gives you the full path root would have when logging in to the system after startup. So directories like /usr/sbin, /sbin or /opt/kde/bin become part of roots path variable after doing su and will be searched for commands.
ad 2) the other possibility is to start /usr/sbin/usermod (giving the full path) or doing ./usermod in the /usr/sbin directory (giving relative path)
# I wrote a simple bash script if this should work
#!/bin/bash
if [ -e /usr/sbin/usermod ];
then
echo "Found the file"
cp /usr/sbin/usermod /usr/bin/usermod
echo "Done, now try to type the command"
else
echo "File not found, try to download the binary somewhere or download the required package"
fi
8day, Welcome to LQ.
Posting to 15 year old threads is generally frowned on, although you did submit one solution to the problem. Unfortunately, it assumes that it knows the location of the file to begin with.
Personally, I’d have tried the find command or the locate command (see the man pages) — or I’d have asked the OP to post their $PATH so we could see if the problem was there.
# I wrote a simple bash script if this should work
#!/bin/bash
if [ -e /usr/sbin/usermod ];
then
echo "Found the file"
cp /usr/sbin/usermod /usr/bin/usermod
echo "Done, now try to type the command"
else
echo "File not found, try to download the binary somewhere or download the required package"
fi
That should never be done. If the file is there, then it is there. Copying it to /usr/bin won't change anything - except violate one of the security protections (minor, but still).
As well as break any updates the distribution may apply.
I just want to say , that when i loged in as su , it gave me the same error. after I read the posts above and did the su - log in again , this time the path to usermod and other things like adding my user account to sudoers all worked.
keep in mind that some us re-new users just want it to work and eventhough I have been using Linux on&off since it was a fraction and I was using those old GOLD cd's to download it to.
anyways count me as a Windows dude , that uses Linux when it's needed. and very happy with Bullseye . just testing HAM RADIO stuff
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.