← Back to team overview

ubuntu-phone team mailing list archive

Re: ANN: changes in adb behavior

 

hi,
Am Freitag, den 05.09.2014, 10:55 +0200 schrieb Oliver Grawert:

> from image 223 upwards adb shell as phablet-shell will log you in as the
> pahblet user, in case you have any scripts that assume root access you
> need to change them.

thanks for all the feedback up to now ... one of the questions i got
most yet was "but how do i run something as root now ?", so here are a
few hints ...

one way is to use sudo -S in your command and to echo the password into
it ... this is not recommended and highlly insecure, since the password
will be visible for everyone in the output of ps ... (this is surely
fine for testing something at home indeed)

assuming your password/pin is 1234:

adb shell "echo 1234| sudo -S <command>"

the slightly more proper way is to put a helper in place and use
SUDO_ASKPASS, this needs a few more commands but will not expose your
password/pin to everyone:

adb shell '/bin/echo -e "#!/bin/sh\necho 1234" >/tmp/askpass'
adb shell "chmod +x /tmp/askpass"
adb shell "SUDO_ASKPASS=/tmp/askpass sudo -A <command>"

i hope that helps ... i will document the new developer mode on the wiki
in more detail (and post the link here) once it landed in the RTM images
too ...

ciao
	oli

Attachment: signature.asc
Description: This is a digitally signed message part


References