On 28/12/13 11:20, Graham Cobb wrote:
> I would like to make a few changes to the login/auth setup for developer
> mode on my phone, to make it more similar to the other embedded devices
> I hack on.
> 
> Does anyone see any problem with doing the following:
> 
> 1) Put an authorized key in /home/nemo/.ssh and set
> "PasswordAuthentication no" in sshd_config.  Remote SSH access would
> then require using the right key.

I've proposed this internally as a toggle on dev-mode (or if I haven't I meant
to). The only 'weakness' I think this introduces is that if you now choose a
weaker password as a result then *if* someone gets access to the device they now
have a way to enable brute-forcing... but I'll live with that since they can
also copy an rpm with suid bash onto your device and install it with pkcon :)

I'm not sure how future updates will handle manually changed config files but I
think we should be OK.

Note that the SDK does something similar and ssh'es in as nemo. It uses a
password for the first-time key setup and thereafter just uses keys - so make
sure you setup SDK access first for a simpler life.

> 2) Set "PermitRootLogin no" in sshd_config.  This disables direct SSH
> access to the root account (allowing me to safely do the following step).

I just add a key to root's authorized_keys. After all you've just disabled
password based login and root has no passwd; this makes ssh from the desktop
trivial and you can use passphrase/agents too.

> 3) Set a password on the root account and enable the account.
You can do this but see answer to 5 and 2

> 4) Use "su -" to gain root access instead of devel-su.
ditto


> 5) Disable devel-su altogether.
> 
> The last two steps assume that devel-su does nothing that su does not,
> except ask for the nemo account password instead of the root password
> and that no important software (e.g. part of booting) uses devel-su.

devel-su is only installed in developer mode. However it's presence is a really
good indicator of developer mode and I'd be cautious of deleting it.

> I must admit I do not like the fact that the developer mode password is
> displayed in the settings.  I realise that anyone with physical access
> to the phone can get root access but I would prefer it to be a tiny bit
> harder than just looking at the password in the settings.

It is not displayed if you set it to a value of your choosing :)
It may be easier to simply alias su to devel-su in your bashrc.

You also then only need to remember one password.

As a comment to other readers: sudo is available in mer-tools repo already.

ssu ar mer-tools
pkcon refresh
pkcon search name sudo
pkcon install sudo

David

> If no one knows of any problems, I will give it a try in the next few
> days and report back.
> 
> Graham
> _______________________________________________
> SailfishOS.org Devel mailing list
> 

_______________________________________________
SailfishOS.org Devel mailing list

Reply via email to