element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs Better way of administering a Linux box without directly logging in as root.
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: jgerred
  • Date Created: 6 Dec 2016 1:33 AM Date Created
  • Views 594 views
  • Likes 2 likes
  • Comments 0 comments
  • computer security day
Related
Recommended

Better way of administering a Linux box without directly logging in as root.

jgerred
jgerred
6 Dec 2016

A lot of folks that set up a computer have a tendency to use an administrator account for every day purposes.  While this does make it easier to use the computer, it causes unnecessary risks from a security standpoint in that administrator access allows anything to run and has the potential to severely corrupt the computer and data.  A better way is to log in to the computer a a regular user and reserve the administrator account for maintenance on the computer. 

 

This can be easily achieved on a Linux box by utilizing the sudo program.  The sudo program basically allows you to log in as a regular user and then execute commands as root.  For example as a regular user, trying to check the status of physical volumes with '/sbin/pvdisplay' yields an error of:

"

  WARNING: Running as a non-root user. Functionality may be unavailable.

  /var/lock/lvm/P_global:aux: open failed: Permission denied

  Unable to obtain global lock.

"

 

The same command using sudo ie 'sudo /sbin/pvdisplay' yields the output of:

"

---snipped for brevity and sanitized---

 

--- Physical volume ---

  PV Name               /dev/sd?

  VG Name               vg_?????????

  PV Size               2.73 TiB / not usable 4.46 MiB

  Allocatable           yes (but full)

  PE Size               4.00 MiB

  Total PE              715396

  Free PE               0

  Allocated PE          715396

  PV UUID               xxxx-xxxxx-xxxxx-xxxxx-xxxxx-xxxx

"

 

Most (if not all) variants of Linux out there have sudo available and it can be installed using your regular software package manager.  Once installed it can be configured via the visudo command which edits the /etc/sudoers file to allow or disallow various options (no password required for sudo access, allow or disallow certain programs to be run by certain users, etc).  The options for sudo are legion and it is a very powerful way of allowing access to administrative level commands without actually logging in as root.

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube