General :: Sudo - Run All Commands With Password?

Feb 16, 2010

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 :

Code:

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 :

Code:

%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

Code:

user1 ALL= NOPASSWD: /bin/mount, /sbin/fdisk

View 1 Replies


ADVERTISEMENT

Programming :: Automate The Password Prompt Required For Sudo Commands?

May 31, 2011

I have written a script to run commands on remote servers, it is working fine. But when I am running "sudo commands" on the remote servers, it asks for me password after prompting for ssh password. I am unable to automate this password prompt (which is just after ssh password prompt). This is the function I am using to provide passwords

Code:

pass ()
{
cd $DIR/"$dt1"_"$dt"
/usr/bin/perl << 'EOF'
use strict;

[code]....

I want the same function to be used , when it expects for sudo passwords for any of the below lines:

Code:

[sudo] password for vikas: orPassword: This is my "cmd" file passed in pass () function.

Code:

ssh -t -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no 192.168.1.100 "bash rcmds"

This is my script output

Quote:

[vikas@box1 ~]$ ./rscript.sh
++ rm -rf /home/vikas/May_31
++ mkdir -p /home/vikas/May_31
++ set +x

[code]....

how to automate the password prompt required for sudo commands.

View 8 Replies View Related

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
Code:
cd /
sudo: cd: command not found

How can I allow a user to execute all commands when a command does not need sudo
Code:
echo -e "Press Control+C to finish"
#echo -e " "
while true;
do
read whichcmd?"Insert Command: "
sudo $whichcmd
done

View 3 Replies View Related

General :: Setting Up User To Use Sudo For Specific Commands?

Jan 17, 2011

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?

View 6 Replies View Related

General :: Can't Execute Commands As Sudo Nor Access Sudoers File In Mandriva 2010.1

Aug 16, 2010

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.

View 4 Replies View Related

General :: Sudo No Password

May 23, 2011

I have an old server running RHEL 5.5 and I normally just type sudo nothing else and I'm instantly root. I copied my sudoers file from here to a new server but it seems not to work cause I type sudo and it ask for usage. Is something else besides the sudoers file that prevents me from logging in with sudo only.

View 5 Replies View Related

General :: How To Get Sudo Password?

Apr 28, 2011

how to get sudo password? login not working for password

View 10 Replies View Related

General :: Safer No Password Sudo?

Nov 22, 2010

This is on my host machine. I'm the only one using it so it's fairly safe, but I have a very complex password that is hard to type over and over. I use the console for moving files around and executing arbitrary commands a LOT, and I switch terminals, so sudo remembering for the console isn't enough (AND I still have to type in my terrible password at least once!) In the past I have used the NOPASSWD trick in sudoers but I've decided to be more secure. Is there any sort of compromise besides allowing no password access to certain apps? (which can still be insecure) Something that will stop malware and remote logins from sudo rm -rf /-ing me, but in my terminals I can type happily away? Can I have this per terminal, perhaps, so just random commands won't make it through? I've tried running the terminal emulations as sudo, but that puts me as root.

View 6 Replies View Related

General :: Sudo With Seprate Password

Oct 7, 2010

Is there a way I can setup sudo with a seprate password other than root and the user password and yet I need it to pull the password from the passwd file. Ok here is why they are wanting to tie the sudo password into cyberark appliance that manages the passwords. So when the user needs to run a root command they would check out a password from cyberark. cyberark changes password from in the password file. So to restate myself is there a way to set sudo up to pull its own password from the password file and not the users or root.

View 3 Replies View Related

General :: Sudo Password Incorrect

Apr 19, 2010

I have set up a new account, with a user name of Benjamin.However, when running a sudo command, while logged in with the user name 'Benjamin', I receive an incorrect password error.Yes, I am entering the password for user name 'Benjamin' and not that of the root account.

View 9 Replies View Related

General :: Enable One User To `sudo` Without A Password?

Jun 4, 2010

How can a user be setup to sudo (or su -) without entering a password?

View 1 Replies View Related

General :: Make Sudo Ask For The Root Password?

Jul 9, 2010

When I run sudo as a normal unprivileged user, it asks for my password, not the root password. That's often convenient, but it reduces the amount of information someone would have to have in order to run commands as root. So how can I make sudo ask for the root password instead of the invoking user's password? I know it'd be done with a line in /etc/sudoers, but I can never seem to properly parse the BNF grammar in the man page to figure out exactly what to write.

View 4 Replies View Related

General :: Sudo Su Runs Without Password Prompt?

May 25, 2011

So here's the problem. We've got the /etc/sudoers file set up so that users can run commands from /bin like "cat" or "mkdir" without entering a password. The problem is that the "su" command is also in /bin, so if they enter "sudo su", it gives them root access without a password. Here's the /etc/sudoers file:

Defaults targetpw
%users ALL=(ALL) ALL
root ALL=(ALL) ALL
support ALL=(ALL) NOPASSWD: /sbin/, /bin/, /opt/, /etc/init.d/, /elo/
support ALL=(ALL) NOPASSWD: /usr/bin/mysql

Is there a way I can deny /bin/su while still allowing the rest of the /bin commands?

View 1 Replies View Related

General :: Sudo For A Single Command With No Password Entry

Apr 20, 2010

I wish to allow a user to use sudo to run a single command (service app status) to determine if my application app is running, in my sudoers file i have: user ALL= /sbin/service app status I understand that there is a parameter called timestamp_timeout that will set the timeout for the 'user', but requires at least 1 entry of the root password.

I wish to allow the user to do "sudo service app status" and not have to enter the root password ever(maybe once is ok), but still make the user enter the root password for all other root activities. Is there a way to prevent the password entry for this command only and no others?

View 3 Replies View Related

General :: Specify Password For Sudo Command When Running Bg Process?

Jun 23, 2010

I'd like to start a background job using the sudo command and route its output to a file. This presents a problem because the prompt for the password doesn't work properly. It looks something like this when I try it:

Code:
Mac:server user$ sudo php crossdomain_server.php > data/crosscomain_output.txt &
[3] 30303
Mac:server user$ Password:
[3]+ Stopped sudo php crossdomain_server.php > data/crosscomain_output.txt
Mac:server user$

Basically I'm not properly prompted for the password and as soon as I type anything in my background job fails because it didn't receive the password. Is there any way to execute a sudo command by supplying the password on the same line as the command?

View 9 Replies View Related

General :: Server Terminal Keyboard Shortcut "F5" To Run Commands Sudo Apt-get Update

Sep 10, 2010

I was wondering is there a way to bind say "F5" to the command sudo apt-get update so I can press one key to write this into the terminal?

View 1 Replies View Related

General :: Sudo And Command Line - Get The Result Without Having To Supply A Password

Mar 31, 2011

I have the following commande /sbin/fuser -f -u /u/DT01/F010107 1>/tmp/null 2>/tmp/seausr.T0069 when executing as root 'su' this give me all user using the file. but when tried with 'sudo' i am asked with 'user password'. Is ther anyway to simply get the result without having to supply a password and to see all user not only me. (i have the file open also).

View 1 Replies View Related

General :: Sudo Command Occasionally Asks For Root Password?

Sep 9, 2010

In Ubuntu 10.04, I logged in as user1 and when I open a new terminal and issue any command it is asking password.user@ubun-laptop:~$ sudo ifconfig[sudo] password for user: It is asking for password only for first time.From the next command onwards it is not asking.Can some one please tell me if it is possible to issue ONLY ONE COMMAND, in which even if the password request comes, it will automatically fill the password.Just like "ps -elf | grep NetworkManager". I am expecting any combination of commands in a single line, so that password is filled automatically IF PASSWORD IS ASKED. If password is not asked, the command must be executed.

View 17 Replies View Related

Ubuntu :: Sudo And Login Password Recognized - Password Box Does Not Like

Apr 27, 2010

I needed to use Synaptic Package Manager to install an app, but the dialog box ("enter the Administrative Password") that pops up before you can use Synaptic doesn't recognize my password ("incorrect password). I tried typing it into a text editor and it's spelled right, caps lock not turned on or anything.

In Terminal, sudo recognizes it, and it is recognized when I log into Ubuntu. I'm the sole user, I have admin privileges, I've been doing admin things.

I just now did System > Administration > Users and Groups and got a dialog box saying

"Failed to contact configuration server; some possible causes are that you need to enable TCP/IP networking for ORBit, or you have stale NFS locks due to a system crash. See [URL] for information. (Details - 1: Server ping error: IDLmg.org/CORBA/COMM_FAILURE:1.0)"

Moving past that, I changed my user password, and Ubuntu authenticated it.

How do you launch Synaptic Package Manager from the command line?

View 4 Replies View Related

Ubuntu :: Can't Do Any Sudo Commands In Terminal

Mar 20, 2010

I was following a guide to stop Ubuntu from always asking the root password. And apparently i messed something up in vsudo edit or something like that i was in... So now when i put in a sudo command i get this...

Quote:

>>> /etc/sudoers: syntax error near line 18 <<<
sudo: parse error in /etc/sudoers near line 18
sudo: no valid sudoers sources found, quitting

so i cant even get back to undo what i edited.

View 8 Replies View Related

Ubuntu :: Unable To Use Sudo And Su - Commands

May 23, 2011

I am unable to use sudo and su - commands. check my output below:

Code:

ubuntu@user1:~$ su -
Segmentation fault
ubuntu@user1:~$ sudo visudo
bash: /usr/bin/sudo: Permission denied

[code].....

View 9 Replies View Related

Security :: Sudo To Disallow Certain Commands?

Jan 10, 2011

trying to devise a new sudoers configuration while building a new SOE and would like to force everyone (including system administrators) to use rootsh in favour of doing things like sudo -s, sudo bash, sudo tcsh and so forth. Effectively, use sudo to use any shell other than rootsh. Is there a way to allow users to run anything they want except shells. I realise this is a default permit which inherently is defective, but I'm not convinced that going through the 1559 executable commands of my (as yet incomplete) built system to decided on the likely 1000+ commands I would want to be genuinely allowed. As I said this is for system administrators first, and I'd like to forcibly instil the habit of sudo <command> or using rootsh to get an audited shell. But I know people are already not doing enough sudo <command> as it stands, rather they switch to bash.

View 7 Replies View Related

Ubuntu :: Login Password To Be Different Then SUDO Password?

Jun 25, 2010

Is it possible to have your login password t be different then your SUDO password. I did a search on sudo password- Almost every post has the term in it.

View 2 Replies View Related

Ubuntu :: Edit Which Commands Require Sudo?

Aug 2, 2010

is there a way to edit which commands require a sudo? or some programs, like the CPU frequency monitor on panel, requires a password to change. where would i start if i want to change this?

View 2 Replies View Related

Ubuntu Servers :: Set Sudo Commands Restrictions

Nov 7, 2010

does anyone know how to set restrictions on the commands a user can run as sudo? i want to make it so they can only halt the system.

View 1 Replies View Related

Ubuntu :: Where To Enter Commands Like $ Sudo /usr/etc/eth0

Aug 28, 2010

I am a Mac/ Windows user, forced to use Linux for my college work. I do not know where to enter commands like $ sudo /usr/etc/eth0 mvntz -do4i or how to make them work

I had a problem - the Wi-fi card in my laptop was not working. All the forums were useless. They wanted me to READ about wireless networking !

Finally a good friend solved the problem in a simple way : it appears Ubuntu has not installed the drivers for my Broadcom wireless card since it was not open source. I had to download it myself. Here is how : Go to System menu on the top bar. Choose administration/ hardware devices. Tell it to activate the device. It will download the drivers through the cable attached to DSL modem and install.

Then clicked the network icon, selected edit connections, and entered my wireless network name and password. This solved all problems.

Why doesn't Linux give me a warning that the driver for something is not yet installed ? When I was struggling with the network setup wizard for the whole day, there was no clue about the missing driver.

View 6 Replies View Related

Slackware :: Sudo Does Not Allow Access To Root Commands

Feb 22, 2011

In order to allow me to shutdown my PC from within fluxbox without being root I ran "visudo" and added the following line:

Code:

psionl0 ALL=(ALL) NOPASSWD: ALL

A check that the line had been accepted showed all ok:

Code:

bash-4.1$ sudo -l

User psionl0 may run the following commands on this host:

(ALL) NOPASSWD: ALL

Yet when I tested it out, I got nowhere:

Code:

bash-4.1$ sudo pkgtool
sudo: pkgtool: command not found
bash-4.1$ sudo shutdown -h now
sudo: shutdown: command not found
bash-4.1$

Have I done something wrong or isn't sudo meant to be used this way?

View 12 Replies View Related

Ubuntu :: Commands - Sudo Kill -9 -1 - Screen Became Blank - Keyboard Not Responding

Jul 11, 2011

I am learning linux commands. I just wanted to see what happens when I type

Code:

The screen became blank. Keyboard was not responding. I couldn't do a proper shutdown. I switched off computer by pulling out the plug. When I restarted, I heard a series of beeps (approximately 10 beeps). Then I was dropped to the grub prompt. The problem now is I can not type anything into the grub prompt, because the character 'c' is continously printed across the screen like this:

Code:

I couldn't stop the character 'c' from printing (I tried pressing Esc, Ctrl+C)

The solution is easy. I can reinstall grub from a livecd. Or even reinstalling the entire operating system wouldn't take more than 30 minutes. But I want to know:

1) What exactly happened to grub? What stage does this error belong to (1, 1.5 or 2)? What is the error number?

2) How can running "sudo kill -9 -1" affect grub?

View 5 Replies View Related

General :: CentOS / Sudo Doesn't Accept Root Password But Logging In As Root Works

Apr 9, 2010

I was trying to edit a file requiring root permissions, so I used sudo. I typed the root password and it failed. This happened three times, and the process was ended. I then logged in as root (su) and was able to navigate to the file and make changes as root. Am I missing something? How would I edit the sudoers file such that this password would work? Or is there another way to log in to the sudo group to make these changes? How do I set sudo passwords?

View 1 Replies View Related

Fedora :: How To SUDO With No Password?

Aug 2, 2010

I made it just like the example in visudo, but every time I exit I get an error: sudoers file: syntax error, line 87 <<<

I have tried it on several machines and always get the same thing, yet it is exactly like the example. Has anyone got an Idea what I am doing wrong ?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved