We have moved to a new Sailfish OS Forum. Please start new discussions there.
7

How to use 'sudo'? [answered]

asked 2014-05-28 16:18:05 +0300

jukey gravatar image

At the moment it is possible to gain root access to the device using devel-su. However in order to allow a bash script to du things with root power I am looking for a 'sudo' like solution. Is there something like this possible? And if yes, how exactly?

edit retag flag offensive reopen delete

The question has been closed for the following reason "the question is answered, an answer was accepted" by hzb
close date 2014-05-28 19:25:37.876799

1 Answer

Sort by » oldest newest most voted
13

answered 2014-05-28 16:25:40 +0300

gabriel gravatar image

updated 2014-06-03 09:17:23 +0300

jukey gravatar image

You have to get them from mer-tools:

devel-su
ssu ar mer-tools
pkcon refresh
pkcon install sudo

Unfortunately sudo is not working out of the box :(

I had to make a link to get visudo working because environment varible for editor is not in correct directory:

devel-su
ln /bin/vi /usr/bin/vi

Then it is possible to add nemo as sudoer by 'visudo' :or an other editor of you choice (e.g. nano):

nemo ALL=(ALL) ALL
edit flag offensive delete publish link more

Comments

1

Maybe someone has the same problem, sudo is not working out of the box :(

I had to make a link to get visudo working because environment varible for editor is not in correct directory:

 devel-su
 ln /bin/vi /usr/bin/vi

Then it is possible to add nemo as sudoer by 'visudo':

nemo ALL=(ALL) ALL
SaimenSays ( 2014-06-02 22:03:37 +0300 )edit

Hi @SaimenSays, thanks for your investigation. :) I added your description directly to the answer. Ciao jukey

jukey ( 2014-06-03 09:18:46 +0300 )edit

Slightly less intrusive:

EDITOR=/bin/vi visudo

should also work just fine.

And while we're being non-intrusive: You may want to add your own file to /etc/sudoers.d/ instead of editing /etc/sudoers:

EDITOR=/bin/vi visudo -f /etc/sudoers.d/my-personal-settings
mcg ( 2014-12-28 16:32:02 +0300 )edit

I am trying to do this, but forgive me, I am new to writing a sudoers file. I tried, but got an error message advising me to use visudo, which I thought I was. I am unsure of what EDITOR means. If possible, could you please kindly give the full (non-intrusive) string to add nemo to the sudoers file? thank you in advance.

Warburgia ( 2018-11-12 11:45:55 +0300 )edit

Question tools

Follow
8 followers

Stats

Asked: 2014-05-28 16:18:05 +0300

Seen: 3,825 times

Last updated: Jun 03 '14