SUSE Support

Here When You Need Us

How to use linux sudo command with visudo

This document (7001451) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 10 SP2
SUSE Linux Enterprise Server 10 SP1
SUSE Linux Enterprise Desktop 10 SP2
SUSE Linux Enterprise Desktop 10 SP1

Situation

How to give sudo permissions to regular users.

Resolution

Use visudo command as root user in order to be able to change /etc/sudoers file and give sudo permissions to regular users.

Examples:

# Giving permissions to all users to mount and umount a cdrom device
%users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom

# Giving permissions to all users to turn off a server using shutdown command
%users  localhost=/sbin/shutdown -h now

# Giving permissions to a specific user to turn off a server using shutdown command
username ALL=NOPASSWD:/sbin/shutdown -h now

Additional Information

Check sudo man page for more details and /etc/sudoers for other examples.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7001451
  • Creation Date: 29-Sep-2008
  • Modified Date:24-Feb-2021
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.