General :: How To Allow User To Execute All Commands Without Sudo
Apr 30, 2010
Customer asked me to create a menu for linux he also asked me to do this: Open like a command like where a user can execute commands...so for this the users have sudo enabled. The code below works OK. But it has an issue when a command is executed but the command does not need sudo
Like for instance
sudo: cd: command not found
How can I allow a user to execute all commands when a command does not need sudo
echo -e "Press Control+C to finish"
#echo -e " "
read whichcmd?"Insert Command: "
since a recent upgrade to Mandriva 2010.1 I am not able to 'sudo' as administrator or when I use the 'root' password. I am the only user on this machine (Dell Inspiron 530S multi-booted with Window's Vista Home Premium, Ubuntu 10.4, and Mandriva 2010.1). I can get into the 'Manage Users' section of the control center by authenticating as 'root' but I can't access 'sudoers file' from command line.
I did some digging on the sudo command and I do know the config file is /etc/sudoers Read the manual for sudoers and found out that I must use visudo to edit the file I read some of the examples at the bottom of the file and tried entering my own account in following the example. one of the commands I was trying to allow my account to perform without root login is the mount command So I tried adding this in (kreid8 /bin/mount ALL) I then saved & exited the file and logged out of root and tried sudo mount -t vfat /dev/sdc1 /media. I got an error saying I had to be root in order to do that But when I use the visudo -l option it shows that I have that privellege. Did I edit the file incorrectly?
I have a question that i want to make a normal user to execute the commands which the root user is able to execute, say if i have a user named siru and when i logged in using siru i cannot run commands like tracert,nmap@loccalhost and all but i can run when i have logged into root account so my question is how to make siru to run the command tracert,nmap@localhost.I have even edited the .bash_profile of siru's home directory from
# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then
I am working in a CentOS environment with numerous CentOS machines. Currently there are multiple developers that each have their own login/home directory and then for various admin tasks we all share a single super user account.
I have a number of aliases, variables, functions, and settings that exist in my personal login's .bash_profile. None of these are available in the shared super user's .bash_profile. My current work around is that everytime I sudo in as the super user and I re-execute my .bash_profile from my personal user's home directory. I am not allowed to edit the init stuff for the super user
Is there any way I can automate my sudo sequence such that it will execute my personal .bash_profile after I've executed sudo without requiring me to edit the super user's bash init stuff?
On my ubuntu I have a command pm-suspend, which puts the computer to sleep. It has to be run with sudo. Since it is inconvenient to be forced to type the password every time I want my computer to sleep, I thought maybe there's a way around it. Naively I thought that if I'd create a script as root, that invokes pm-suspend, and then let anyone execute that script, I could run that script as my own user and then that script would be considered run by root and hence be allowed to run pm-suspend. Obviously that didn't work. The root-check procedure in pm-suspend still found out that the original executor was someone different from root.
Still I think something similar (although slightly more elaborate) should work.I'm thinking about the process that allows the user to mount hard drives for example. Normally root is required, but it is somehow bypassed by the gnome utility mounting.
Having a problem with sudo. I'm down as a user who can run all commands as root provided I enter my password. The relevant line from my /etc/sudoers file :
user1 ALL=(ALL) ALL
There are several commands that I run quite frequently such as mount and fdisk but would like to avoid having to enter a password each time I use them. What would be the appropriate change to the sudoers file ?
UPDATE: I neglected to scroll down to the bottom of the /etc/sudoers file where there was the line :
%admin ALL=(ALL) ALL
and since user1 was a member of the admin group any predeeding lines were being overidden by this. Commenting out this line and adding
ssh to a machine on my network open up a terminal (gnome, xterm, whatever) and have it visible on that machines display be able to type and execute commands in that window, from my computer. i have kind of achieved this. on machine A, i ssh to machine B. on machine B, i open up a terminal and execute screen, C-a :multiuser on. on machine A, i execute screen -x and connect to the term on B. everything i type from A or B can be seen. i just want to be able to set this up without having to physically be at machine B. does that make sense?
I've looked everywhere but I can't find where to change the default box for incoming mail, or am I on the wrong track. It's a nuisance having to change folders and I can't configure wastebin to empty on exit.And I can't get kmail to import from evolution. Do I have to go to the evolution storage and do it manually, and if so, how do I do that?
In gnome terminal it is possible to open multiple tabs with Quote:$ gnome-terminal --tab-with-profile=jake_lardasset --tab-with-profile=virtualsexgranny -x alpineWe got even further....Quote:gnome-terminal --tab-with-profile=james_treesexer --command pymol --tab-with-profile=loverboy13 --command alpineand pymol runs, but not in the tab and alpine runs in the tab.The problem is, that when using a script to check mail it has Quote:gnome-terminal --tab-with-profile=chrissypink --command alpine --tab-with-profile=jake_hugerichard -x ssh email@example.com the other way aroundIs there a simpler way to do this?And why is it not possible to execute ssh with the --command parameter and -x has to be used ,but top and so on can be executed with --command
When I try execute a variety of basic commands (including ps, ls, ifconfig, locate), I receive the error 'no such file or directory'.
Here are some suggestions that I've found online, that I have tried without success: I did a 'whereis ps' and found the file in the /bin/, and have checked that '/bin' appears when I do 'echo $PATH' I did a filesystem check which showed my hard drive as being clean I tried doing a 'sudo chmod 777 ps' but was told that I dont have permission. I don't think permissions for these files would have changed though (and I can't check as I can't run the 'ls' command).
i am working on some kind of PBX and i have list of telephone numbers inside a file, i have to insert these numbers into the correct command and then telnet to a remote server and execute these commands. i can read the telephone numbers and insert them into the command with no problem, but when i try to insert these commands into the send i face problem. here is the basic code
i can make external loop inside the Bash which read the input file and issue the command and then telnet and execute, but this will make the script connects and disconnects again for each line which cause high load on that server and hardwar problem. i am wondering if there is an option inside the expect interperter which makes the send read directly from a file... somthing like this:
i was wondering if it is possible to run a program such as firefox or any other internet program as its own user (ie user firefox), but still in my desktop session, this way the program would have its own home folder and store all the data there, while i use it normally, i was trying to set the suid on the firefox binaries but then it doesn't starts at all.
Is possible (by root of course) to run a command from console, that will be executed on X-session owned by another user on the same linux box/machine ? Example: Can root open xclock for another local user logged into X11 ?
how to execute commands on startup. I've added lines to /etc/rc.d/rc.local, /etc/rc.local, I've put scripts (with extension .sh) into /etc/init.d/ and I've set the executable permission thing on all of them with chmod -x. I *still* can't get anything at all to execute on startup. The truth is, I'm trying to enable multitouch and button tapping automatically when I startup Fedora. I have the commands
Which I want to execute whenever I start Fedora (it's a bit tedious to write them every time, or even to have to execute a script myself whenever I start my computer). Furthermore, if I can figure this out, then I can do all sorts of things. Does anyone have a clear, surefire way in which I can do this? I'm not good with using Linux at all
I am executing a run command in a script after that i need to copy files into a directory which are the inputs for the run,on run a new shell is created and the remaining commands in the script does not execute,wot should i do to execute the remaining commands in the script??