-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any way to run smartctl without (unrestricted) root privileges? #205
Comments
Smartctl need to use pass-through I/O controls on raw disk devices. These need root privileges, which is good, because you could send arbitrary commands to the device. There are usually no limited (read-only) variants of such I/O controls available which work also with normal user privileges. Conclusion: It depends on the available functionality of the OS kernel. Such enhancement requests need first to be addressed to the kernel developers. If such functionality is available, it could be added to smartctl. |
As was mentioned before - depends on OS. E.g. in macOS for the SMART API root is not required, as a downside - it is very limited compared to other operating systems. You may also run |
You could also try to run a private copy of |
I was wondering if there any way to run smartctl without full root permissions?
There are posts like https://medium.com/opsops/why-smartctl-could-not-be-run-without-root-7ea0583b1323 which even attempt to explain why it cannot be used without root.
Especially when running persistent monitoring tools like the https://github.com/prometheus-community/smartctl_exporter running them as root can become a security issue or unnecessary attach surface.
With all those features of recent kernels and also systemd to run processes such as the with certain CAPS or other restrictions and limitation I was wondering if it really is not possible to at least narrow down the access rights.
The text was updated successfully, but these errors were encountered: