Red Hat :: Setup User's PATH Env When Sudo Command In RHEL5 ?
Dec 16, 2008
In RHEL5, the PATH of root is /sbin and /usr/sbin...., the PATH of common user has not /sbin or /usr/sbin, how to give the /sbin and /usr/sbin to a common user when he run command which sudo?
On my Ubuntu server I'm running into an issue that I've never seen before even though I've been using Linux for many years. Basically sudo is not finding a command located in my path. Here is a transcript illustrating the problem.
following mjmwired instructions, I manually setup the sudo but I keep getting a parse error whenever sudo command is run. How do I fix this issue?I login as su -, then setup sudo using "echo 'myusername ALL=(ALL) ALL' >> /etc/sudoers". All appears OK. I exit su, and go back to myusername.
How do you setup the sudo command so that it will insult the user if they enter the wrong password? I know it sounds kind of random, but I found that it was an option while looking up something else. I tried adding "Defaults insults" using visudo, and commenting out "Defaults targetpw" and "ALL ALL=(ALL) ALL", and adding my username as "blank888 ALL=(ALL) ALL" but I still can't get it to work right.
I wrote a shell script and was able to compile it using SHC. after that i copied it to the /bin folder and tried running it as a normal user, but i keep getting the error " operation not permitted killed "
I tried changing the permissions. but it doesn't work. it only works with sudo. there must be another way. otherwise it won't be linux right?
I have a problem about user permission, I just destroy my user...So, I create a new one. But I can't have the permission to use "sudo" or to install program... So, I cannot do a lot of thing in my computer. The logical solution is to boot in failsafe mode and access to the root terminal, but, I don't know how to change the permission to allow me to use sudo.
I was wondering if someone had a logical reason and therefore complete, hopefully that makes total sense, for why when I install Ubuntu I cannot use the 'sudo' command either with root or user passwords. Even if I try to edit the permissions for sudoers, I still recieve an error message that says access is denied and so as the root user on my pc I don't understand why I can't put my name in the sudoers file or use the sudo command with the correct password.
I adjusted some settings in the desktop settings folder in KDE. I had only one user account on the machine. Next time I rebooted I could not log into KDE (it kept bombing out). I had to log into the console. Finally I managed to create a new account with useradd but this user cannot sudo
My problem is that my home directory is encrypted, so I need a new user with sudo privileges to delete all the kde files and folders in my original users home directory so that I can start with a new KDE setup (which won�t be a bad thing since I tinkered a lot).
How can I add sudo privileges to the new account (I presume I can do it by logging in with my sudo account in a terminal login?
need to know, how we can display the whole (till current directory) path in below highlighted way. normally it shows only the name of current working directory after the server name.
If I try "shutdown" as a normal user on Debian it give the "command not found" error. OK it's not in my PATH. But if I "sudo shutdown" it works. Somehow sudo seems to change my PATH.
Do the same in Slackware however and sudo makes no difference, I get "command not found" each time.
In short: how to make sudo not to flush PATH everytime?
I have some websites deployed on my server (Debian testing) written with Ruby on Rails. I use Mongrel+Nginx to host them, but there is one problem that comes when I need to restart Mongrel (e.g. after making some changes).
All sites are checked in VCS (git, but it is not important) and have owner and group set to my user, whereas Mongrel runs under the, huh, mongrel user that is severely restricted in it's rights. So Mongrel must be started under root (it can automatically change UID) or mongrel.
To manage mongrel I use mongrel_cluster gem because it allows starting or stopping any amount of Mongrel servers with just one command. But it needs the directory /var/lib/gems/1.8/bin to be in PATH: this is not enough to start it with absolute path.
Modifying PATH in root .bashrc changed nothing, tweaking sudo's env_reset and env_keep didn't either.
So the question: how to add a directory to PATH or keep user's PATH in sudo?
When I try to run almost any command with sudo, it returns sudo: command: command not found. When I run sudo echo $path, it returns a blank line. Is there a command to set its path back to the default?
I'm attempting to add a directory to PATH so it's available when I sudo. (I do not want to sudo -i), but it's not behaving as I expect.I've added a line to add the directory to PATH in all of these files:
I'm having a strange issue with the PATH variable when running the command 'sudo su'. When executing this command the PATH variable changes. No problems there, but it changes to:
Code:
Looking at this, there are two weird entries (//sbin and //bin) which should both start '/usr' instead. I'm not sure how I've managed to change this, or how a piece of software I'm using has done it (more likely it was me I expect), but could anyone suggest which file to look in to correct it? If it makes a difference the machine is running CentOS 5.
Original HOWTO can be found at: [URL]... So the other day I was in IRC and someone had brought up a problem where they created a new Administrative user, but didnt have rights to use sudo. Looked into the problem a little bit to figure out what was wrong, and it turns out that when you create a new user through the user manager (in kubuntu, anyways. Havent tested in Gnome.) the user gets added to the adm group, however, a quick look at the sudoers file shows that its looking for users in the admin group to allow the use of sudo. So, to solve the problem we do the following: If youre on the new admin user (which Im assuming you are) use the following commands:
Code: su [insert username of old account without brackets] sudo usermod -G admin [username of new admin account without brackets] exit
Then simply logout, and then log back in (not always necessary, but the easiest way to flush the permissions.)
Code: su [insert username of old account without brackets] Means were going to Switch User to the old admin account Code: sudo usermod -G admin [username of new admin account without brackets] This simply adds the admin group to the secondary group list for the new user Code: exit Pretty self explanatory
I've installed rubygems on ubuntu, but it has a known issue that the rubygems' bin/ directory is not in the PATH. I know about exporting the PATH variable, and adding it to .bashrc, but I'd like to configure it so that every user has it on his PATH, even if he tries to run it with sudo. Where should I export the PATH variable then?
After saving above changes, I enter the command: source ~/.bashrc Now if I do echo $PATH, the path shows both the old PLAY_HOME and new PLAY_HOME. This is really bad and messes up a lot of things in my project. This problem only goes away if I logout or reboot, a rather very long process. What is happening is that the old path is added to new path element and the old path includes the old path element you want to remove.
I am having trouble running commands by using sudo. I configured visudo file with localuser ALL=(ALL) ALL but I can't run any command, it tells me command not found.
How to setup Dynamic Multipathing in RHEL5 and mapping a device to it? I have a RHEL5 server which is connected with a HP BLADE Server. I have installed DM software. Now I want to map BLADE Server's LUN space with a directory of my RHEL5 Server.
I am using FF ver 5.0.1 from here After reading [URL] I did Code: sudo aa-logprof /path to firefox Allowed all when asked. But when I try to start FF in enforce mode I get
I am newbie in Linux, using RHEL5. I created an account for user. User cannot log on from GUI but able to log on from command line by (ctrl-alt-f1). As a root I can log on from GUI mode.
I have a Dell ml6000 as a network accessed tape library, I need to mount the tape library on my RHEL5 server as a nst* so I can setup backup crons. What is the process i need to follow to set thsi up?