Sudos Argumente können nicht als nicht-root in Fedora 16 verwendet werden

1014
Drakonas

Ich verwende eine lange installierte Fedora 16-Box, und wenn ich als regulärer Benutzer (nicht root) "sudo -v", "sudo -l" usw. eingebe, erhalte ich folgende Ausgabe:

[user@* ~]$ sudo -v env: -v: No such file or directory [user@* ~]$ 

Irgendetwas bewirkt, dass Sudo denkt, dass "-v" ein Prozess ist, der ausgeführt wird.

Ich habe dies gefunden, als ich versuchte, den NOPASSWD-Zugriff für eine bestimmte ausführbare Datei einzurichten, die ich zu / usr / bin hinzugefügt habe, was ebenfalls nicht funktioniert (es fragt immer noch nach einem Kennwort).

Muss ich nebenbei die sudo config neu laden oder etwas, wenn ich die / etc / sudoers ändere? Wird die Datei / etc / sudoers überhaupt in Fedora 16 verwendet?

Hier ist meine / etc / sudoers-Konfiguration:

## Sudoers allows particular users to run various commands as ## the root user, without needing the root password. ## ## Examples are provided at the bottom of the file for collections ## of related commands, which can then be delegated out to particular ## users or groups. ##  ## This file must be edited with the 'visudo' command.  ## Host Aliases ## Groups of machines. You may prefer to use hostnames (perhaps using  ## wildcards for entire domains) or IP addresses instead. # Host_Alias FILESERVERS = fs1, fs2 # Host_Alias MAILSERVERS = smtp, smtp2  ## User Aliases ## These aren't often necessary, as you can use regular groups ## (ie, from files, LDAP, NIS, etc) in this file - just use %groupname  ## rather than USERALIAS # User_Alias ADMINS = jsmith, mikem   ## Command Aliases ## These are groups of related commands...  ## Networking # Cmnd_Alias NETWORKING = /sbin/route, /sbin/ifconfig, /bin/ping, /sbin/dhclient, /usr/bin/net, /sbin/iptables, /usr/bin/rfcomm, /usr/bin/wvdial, /sbin/iwconfig, /sbin/mii-tool  ## Installation and management of software # Cmnd_Alias SOFTWARE = /bin/rpm, /usr/bin/up2date, /usr/bin/yum  ## Services # Cmnd_Alias SERVICES = /sbin/service, /sbin/chkconfig  ## Updating the locate database # Cmnd_Alias LOCATE = /usr/bin/updatedb  ## Storage # Cmnd_Alias STORAGE = /sbin/fdisk, /sbin/sfdisk, /sbin/parted, /sbin/partprobe, /bin/mount, /bin/umount  ## Delegating permissions # Cmnd_Alias DELEGATING = /usr/sbin/visudo, /bin/chown, /bin/chmod, /bin/chgrp   ## Processes # Cmnd_Alias PROCESSES = /bin/nice, /bin/kill, /usr/bin/kill, /usr/bin/killall  ## Drivers # Cmnd_Alias DRIVERS = /sbin/modprobe  # Defaults specification  # # Disable "ssh hostname sudo <cmd>", because it will show the password in clear.  # You have to run "ssh -t hostname sudo <cmd>". # Defaults requiretty  Defaults env_reset Defaults env_keep = "COLORS DISPLAY HOSTNAME HISTSIZE INPUTRC KDEDIR LS_COLORS" Defaults env_keep += "MAIL PS1 PS2 QTDIR USERNAME LANG LC_ADDRESS LC_CTYPE" Defaults env_keep += "LC_COLLATE LC_IDENTIFICATION LC_MEASUREMENT LC_MESSAGES" Defaults env_keep += "LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER LC_TELEPHONE" Defaults env_keep += "LC_TIME LC_ALL LANGUAGE LINGUAS _XKB_CHARSET XAUTHORITY"  Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin  ## Next comes the main part: which users can run what software on  ## which machines (the sudoers file can be shared between multiple ## systems). ## Syntax: ## ## user MACHINE=COMMANDS ## ## The COMMANDS section may have other options added to it. ## ## Allow root to run any commands anywhere  root ALL=(ALL) ALL  ## Allows members of the 'sys' group to run networking, software,  ## service management apps and more. # %sys ALL = NETWORKING, SOFTWARE, SERVICES, STORAGE, DELEGATING, PROCESSES, LOCATE, DRIVERS  ## Allows people in group wheel to run all commands %wheel ALL=(ALL) ALL  ## Same thing without a password # %wheel ALL=(ALL) NOPASSWD: ALL  ## Allows members of the users group to mount and unmount the  ## cdrom as root # %users ALL=/sbin/mount /mnt/cdrom, /sbin/umount /mnt/cdrom  ## Allows members of the users group to shutdown this system # %users localhost=/sbin/shutdown -h now  ## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment) #includedir /etc/sudoers.d user ALL=(ALL) NOPASSWD: /usr/bin/fastboot* 

Hinweis: In der letzten Zeile meiner aktuellen Konfiguration habe ich meinen Benutzernamen durch "user" ersetzt.

Außerdem wurde mir gesagt, dass Sie *, [0-9] usw. in der sudoers-Konfiguration verwenden können, und der Befehl fastboot hat Argumente, auf die ich meinem Benutzer Zugriff gewähren möchte. (Es gibt unendlich viele Argumentationsmöglichkeiten, und ich möchte auf alle zugreifen.) Vielleicht irre ich mich dafür, den Platzhalter zu benötigen, aber ich habe diese Konfigurationsdatei bereits ohne sie ausprobiert und sie hat auch nicht funktioniert.

Und hier ist meine sudo -V Ausgabe:

Sudo version 1.8.3p1 Configure options: --build=i386-redhat-linux-gnu --host=i386-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info --prefix=/usr --sbindir=/usr/sbin --libdir=/usr/lib --docdir=/usr/share/doc/sudo-1.8.3p1 --with-logging=syslog --with-logfac=authpriv --with-pam --with-pam-login --with-editor=/bin/vi --with-env-editor --with-ignore-dot --with-tty-tickets --with-ldap --with-selinux --with-passprompt=[sudo] password for %p: --with-linux-audit Sudoers policy plugin version 1.8.3p1 Sudoers file grammar version 40  Sudoers path: /etc/sudoers nsswitch path: /etc/nsswitch.conf ldap.conf path: /etc/ldap.conf ldap.secret path: /etc/ldap.secret Authentication methods: 'pam' Syslog facility if syslog is being used for logging: authpriv Syslog priority to use when user authenticates successfully: notice Syslog priority to use when user authenticates unsuccessfully: alert Ignore '.' in $PATH Send mail if the user is not in sudoers Use a separate timestamp for each user/tty combo Lecture user the first time they run sudo Require users to authenticate by default Root may run sudo Allow some information gathering to give useful error messages Only allow the user to run sudo if they have a tty Visudo will honor the EDITOR environment variable Set the LOGNAME and USER environment variables Length at which to wrap log file lines (0 for no wrap): 80 Authentication timestamp timeout: 5.0 minutes Password prompt timeout: 5.0 minutes Number of tries to enter a password: 3 Umask to use or 0777 to use user's: 022 Path to mail program: /usr/sbin/sendmail Flags for mail program: -t Address to send mail to: root Subject line for mail messages: *** SECURITY information for %h *** Incorrect password message: Sorry, try again. Path to authentication timestamp dir: /var/db/sudo Default password prompt: [sudo] password for %p:  Default user to run commands as: root Value to override user's $PATH with: /sbin:/bin:/usr/sbin:/usr/bin Path to the editor for use by visudo: /bin/vi When to require a password for 'list' pseudocommand: any When to require a password for 'verify' pseudocommand: all File descriptors >= 3 will be closed before executing a command Reset the environment to a default set of variables Environment variables to check for sanity: TERM LINGUAS LC_* LANGUAGE LANG COLORTERM Environment variables to remove: RUBYOPT RUBYLIB PYTHONUSERBASE PYTHONINSPECT PYTHONPATH PYTHONHOME TMPPREFIX ZDOTDIR READNULLCMD NULLCMD FPATH PERL5DB PERL5OPT PERL5LIB PERLLIB PERLIO_DEBUG  JAVA_TOOL_OPTIONS SHELLOPTS GLOBIGNORE PS4 BASH_ENV ENV TERMCAP TERMPATH TERMINFO_DIRS TERMINFO _RLD* LD_* PATH_LOCALE NLSPATH HOSTALIASES RES_OPTIONS LOCALDOMAIN CDPATH IFS Environment variables to preserve: XAUTHORITY _XKB_CHARSET LINGUAS LANGUAGE LC_ALL LC_TIME LC_TELEPHONE LC_PAPER LC_NUMERIC LC_NAME LC_MONETARY LC_MESSAGES LC_MEASUREMENT LC_IDENTIFICATION LC_COLLATE LC_CTYPE LC_ADDRESS LANG USERNAME QTDIR PS2 PS1 MAIL LS_COLORS KDEDIR INPUTRC HISTSIZE HOSTNAME DISPLAY COLORS Locale to use while parsing sudoers: C Directory in which to store input/output logs File in which to store the input/output log Add an entry to the utmp/utmpx file when allocating a pty  Local IP address and netmask pairs: 192.168.1.88/255.255.255.0 fe80::216:76ff:feb2:49a2/ffff:ffff:ffff:ffff:: fe80::214:d1ff:fed5:60e9/ffff:ffff:ffff:ffff::  Sudoers I/O plugin version 1.8.3p1 

Wenn mir jemand helfen könnte, diese 2 Probleme zu beheben, wäre das nett. Um ehrlich zu sein, wenn mir jemand sagen könnte, warum Fastboot (Android-Partition Flash-Tool, über USB) Root-Zugriff auf meine Linux-Box benötigt, und mir dann eine einfachere Möglichkeit zeigt, diesen Lauf auszuführen, ohne nach Root-Zugriff zu fragen, wäre das schön. Mein alter Linux brauchte aus irgendeinem Grund keinen Root-Zugriff für Fastboot.

Beachten Sie auch die Sicherheit. Ich habe nicht vor, alles als root laufen zu lassen, ohne ein Passwort zu benötigen. Vielen Dank.


Ich habe das gerade in meiner .bashrc gefunden:

alias sudo='sudo env PATH=$PATH' 

Ich habe vergessen, es hinzugefügt zu haben. Ich hatte in der Vergangenheit einige Probleme mit $ PATH-Befehlen.

Ich habe die Leitung entfernt und meine Probleme sind jetzt behoben. Danke ... ich schätze. * seufzt Ich bin ein Power User und ich scheine immer mein eigenes Problem zu lösen. Ich kann ehrlich sagen, dass ich das seit fast 5 Jahren getan habe, ohne dass jemand geholfen hat. Das ist traurig.

2
Ich habe das gerade in meiner .bashrc gefunden. "alias sudo = 'sudo env PATH = $ PATH'" Ich habe vergessen, dass ich es hinzugefügt habe. Ich hatte in der Vergangenheit einige Probleme mit $ PATH-Befehlen. Drakonas vor 11 Jahren 0
Das wäre das Problem. Sie können Ihre Frage entweder löschen oder selbst beantworten! slm vor 11 Jahren 0
Ja entschuldigung. Ich habe vergessen, es 6 Stunden später zu beantworten. : P Aktualisierung. Drakonas vor 11 Jahren 0

1 Antwort auf die Frage

2
Drakonas

Ich hatte dies in meiner .bashrc gefunden:

alias sudo='sudo env PATH=$PATH' 

Ich habe vergessen, es hinzugefügt zu haben. Ich hatte in der Vergangenheit einige Probleme mit $ PATH-Befehlen.

Ich habe die Leitung entfernt und meine Probleme sind jetzt behoben. Danke ... ich schätze. * seufzt Ich bin ein Power User und ich scheine immer mein eigenes Problem zu lösen. Ich kann ehrlich sagen, dass ich das seit fast 5 Jahren getan habe, ohne dass jemand geholfen hat. Das ist traurig.