1

I want to initiate zypper command without the entry of sudo. For example,

zypper update

I attempt to change the permission bit of the zypper file located at /usr/bin folder. I assume that with allow me to run the zypper command without sudo command.

-rwxr-sr-x 1 root root 1942112 Oct 10 19:21 /usr/bin/zypper

I added current user to root group; this file should be able to run as root.

6
  • You made the file setgid, yet group root is just an ordinary group. And adding the current user to group root is useless. Do you understand what the setuid and setgid bits do? Commented Dec 2, 2017 at 6:08
  • I assume that the file will be ran as root group. which means it can bypass root privelege Commented Dec 2, 2017 at 6:14
  • 1
    From where did you get the impression that membership in the group root confers any special privileges? Can you provide a quotation? Commented Dec 2, 2017 at 6:19
  • strange, I added setuid instead, and it works. I assume that the error is related to root UID. Commented Dec 2, 2017 at 6:31
  • 1
    @AlexP Make that an answer so that this question does not look unsolved any more. Commented Dec 2, 2017 at 8:43

1 Answer 1

1

strange, I added setuid instead, and it works.

For a binary to run with root privileges when invoked by any other user, it must be setuid. You can do it as follows:

$ sudo /usr/bin/chmod 4755 /usr/bin/zypper

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.