Enviado em 08/06/2017 - 18:03h
Em uma das minhas instalações de Sabayon, mesmo com o arquivo /etc/sudoers editado....# Arquivo SUDOERS, do sudo de Sabayon Linux, modificado: ## sudoers file. ## ## This file MUST be edited with the 'visudo' command "sudo visudo" ## Failure to use 'visudo' may result in syntax or file permission errors ## that prevent sudo from running. ## ## See the sudoers man page for the details on how to write a sudoers file. ## ## ## Host alias specification ## ## Groups of machines. These may include host names (optionally with wildcards), ## IP addresses, network numbers or netgroups. # Host_Alias WEBSERVERS = www1, www2, www3 ## ## User alias specification ## ## Groups of users. These may consist of user names, uids, Unix groups, ## or netgroups. # User_Alias ADMINS = millert, dowdy, mikef ## ## Cmnd alias specification ## ## Groups of commands. Often used to group related commands together. # Cmnd_Alias PROCESSES = /usr/bin/nice, /bin/kill, /usr/bin/renice, \ # /usr/bin/pkill, /usr/bin/top # Cmnd_Alias REBOOT = /sbin/halt, /sbin/reboot, /sbin/poweroff ## ## Defaults specification ## ## You may wish to keep some of the following environment variables ## when running commands via sudo. ## ## Locale settings # Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET" ## ## Run X applications through sudo; HOME is used to find the ## .Xauthority file. Note that other programs use HOME to find ## configuration files and this may lead to privilege escalation! # Defaults env_keep += "HOME" ## ## X11 resource path settings # Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH" ## ## Desktop path settings # Defaults env_keep += "QTDIR KDEDIR" ## ## Allow sudo-run commands to inherit the callers' ConsoleKit session # Defaults env_keep += "XDG_SESSION_COOKIE" ## ## Uncomment to enable special input methods. Care should be taken as ## this may allow users to subvert the command being run via sudo. # Defaults env_keep += "XMODIFIERS GTK_IM_MODULE QT_IM_MODULE QT_IM_SWITCHER" ## ## Uncomment to use a hard-coded PATH instead of the user's to find commands # Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" ## ## Uncomment to send mail if the user does not enter the correct password. # Defaults mail_badpass ## ## Uncomment to enable logging of a command's output, except for ## sudoreplay and reboot. Use sudoreplay to play back logged sessions. # Defaults log_output # Defaults!/usr/bin/sudoreplay !log_output # Defaults!/usr/local/bin/sudoreplay !log_output # Defaults!REBOOT !log_output ## ## Runas alias specification ## ## ## User privilege specification ## root ALL=(ALL) ALL # Todos os usuarios do grupo especial "wheel" podem usar sudo. Descomente # para usar, ou alternativamente, adicione seu usuário ao grupo "wheel": # sudo usermod -aG wheel USUARIO ## Uncomment to allow members of group wheel to execute any command %wheel ALL=(ALL) ALL ## Same thing without a password %wheel ALL=(ALL) NOPASSWD: ALL ## Uncomment to allow members of group sudo to execute any command # %sudo ALL=(ALL) ALL ## Uncomment to allow any user to run sudo if they know the password ## of the user they are running the command as (root by default). # Defaults targetpw # Ask for the password of the target user # ALL ALL=(ALL) ALL # WARNING: only use this together with 'Defaults targetpw' # Usuário normal, para usar sudo com senha: albfneto ALL=(ALL) ALL # usuario normal pode desligar o computador: albfneto ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/reboot, /sbin/shutdown
Enviado em 08/06/2017 - 18:11h
Um exemplo de um trecho de /etc/sudoers para Debian seria# User privilege specification root ALL=(ALL:ALL) ALL # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL
Enviado em 08/06/2017 - 18:27h
Eu geralmente deixo os grupos wheel e sudo desabilitados, deixando apenas o usuário e o root, assim eu deixaria assim o seu /etc/sudoersroot ALL=(ALL) ALL albfneto ALL=(ALL) ALL albfneto ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/reboot, /sbin/shutdown #%wheel ALL=(ALL) ALL #%wheel ALL=(ALL) NOPASSWD: ALL # %sudo ALL=(ALL) ALL
Enviado em 08/06/2017 - 18:36h
respostas.... sim estou no grupo Wheel, mas não no grupo sudosudo gpasswd -d albfneto wheel
Enviado em 08/06/2017 - 18:57h
Nord, sim há a linha que citou, mas comentada. Mas eu estav no grupo wheel, já tirei meu usuário.Enviado em 08/06/2017 - 19:01h
Não tem um comando que faz o usuário da sessão corrente ter todas as informações de arquivos como /etc/passwd e /etc/group serem recarregadas?Enviado em 08/06/2017 - 20:18h
Himen3auth sufficient pam_rootok.so auth required pam_wheel.so use_uid auth include system-auth account include system-auth password include system-auth session include system-auth session required pam_env.so session optional pam_xauth.so
# File autogenerated by pamd_mimic in pam eclass auth include system-auth account include system-auth session include system-auth
auth required pam_env.so auth required pam_unix.so try_first_pass likeauth nullok auth optional pam_permit.so account required pam_unix.so account optional pam_permit.so password required pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3 password required pam_unix.so try_first_pass use_authtok nullok sha512 shadow password optional pam_permit.so session required pam_limits.so session required pam_env.so session required pam_unix.so session optional pam_permit.so -session optional pam_systemd.so
Enviado em 08/06/2017 - 20:53h
Você saberia dizer onde foi alterado ou fez cópia deles antes de mexer?Como gerar qualquer emoji ou símbolo unicode a partir do seu teclado
Instalar e Configurar o Slackware Linux em 2025
Como configurar os repositórios do apt no Debian 12 em 2025
Passkeys: A Evolução da Autenticação Digital
Instalação de distro Linux em computadores, netbooks, etc, em rede com o Clonezilla
Muitas dificuldades ao instalar distro Linux em Notebook Sony Vaio PCG-6131L (VPCEA24FM)
Slackpkg+ (Slackpkg Plus) está de volta!
Como dividir duas janelas igualmente e lado-a-lado na sua tela
Configurando o Conky para iniciar corretamente no sistema
3 configurações básicas que podem melhorar muito a sua edição pelo editor nano
Minha rede tem um espaço invisível que não dá pra digitar o nome da re... (1)
Pedagogia no brasil não passa de alfabetização por m4sturbação mental ... (2)
compilação samba 4.22 rock linux 9.5 (3)
Erro de segmentação «Segmentation fault (core dumped)» ao retornar obj... (7)