Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
Just installed a new email server running Red hat 7.2. I installed SSH and I can remotely SSH to the box fine, login and stuff, but a lot of the usual bash commands that Im used to are gone.
For example, useradd, userdel, usermod, route, fsck, as well as some others, are all missing.
I have my shell set as bash which is installed and working. When I log in, I don't get a 'missing shell' error, I just get the familiar bash prompt. Even when I 'su', I still can't use these commands.
HOWEVER, when I login locally as root, all the commands are there using bash.
Is there a separate profile for ssh/remote logins? If so, there may be some restrictions in there. Maybe check the startup sequence for SSH and see what it's reading for its configuration.
I installed SSH as an RPM when I installed everything else and left all the defaults in place. I checked sshd_config and couldn't find anything about paths.
I've noticed that when I do an env $PATH when remotely connected with SSH, that my path is really short(/bin:/usr/bin:/usr/local/bin), however it's a lot longer when locally connected with root.
You can set the PATH for a single session by doing
export PATH=$PATH:/whatever/you/want
To make it "sticky" for all future sessions it needs to be read from a config or profile file (i.e. for users that can be ~/.bash_profile or ~/.bashrc - the global profile is /etc/profile). That's why I'm thinking there is a similar file for ssh/remote logins - even though you're logging in as an existing user.
Here's a link I found on Red Hat's site for SSH - see if this helps:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.