Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want a user script to check how long the last "hibernation phase" is gone. E.g. the question is "how long is this system awake?"
'uptime' just gives me the time since last boot - and reading the syslog requires a user to be a member of group adm (which I don't want).
so you can write a script that runs as a user who is member of that group and execute it with sudo.
You can configure sudo to allow to execute only this script and nothing else.
so you can write a script that runs as a user who is member of that group and execute it with sudo.
You can configure sudo to allow to execute only this script and nothing else.
Thanks for that!
Since I always avoided using sudo I tried something else. SSH is installed on all of my boxes, so why not do a
Code:
ssh root@localhost 'bla'
All I had to do for making this possible was (as root):
Yes, you can do that too, just it will give much more rights.
Well, yes. But for me it's just about avoiding sudo (just don't want to learn the "syntax" of sudoers), and all of this happens on a local box at home. My network is not connected to a power plant or something.
Well, yes. But for me it's just about avoiding sudo (just don't want to learn the "syntax" of sudoers), and all of this happens on a local box at home. My network is not connected to a power plant or something.
So, I don't have any security concerns. Do you?
Gregor
That is funny. You don't want to add the user to the group, instead, you will give full access. Ok, I have no concerns.
dgb boulder = (operator) /bin/ls, /bin/kill, /usr/bin/lprm
The user dgb may run /bin/ls, /bin/kill, and /usr/bin/lprm-but only as operator. E.g.,
$ sudo -u operator /bin/ls
Most easy is the ALL wildcard:
Code:
echo "ALL ALL=(ALL) cat /var/log/syslog" > /etc/sudoers.d/readsyslog
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.