SSH key access to AR750S

To create the keys you can follow this guide:

To enable sudo you need to run a few commands directly in SSH:

Install sudo:

opkg update
opkg install sudo

Configure sudo:

sed -i 's/# %sudo.ALL=(ALL) ALL/%sudo ALL=(ALL) ALL/g' /etc/sudoers
sed -i 's/# Defaults targetpw/Defaults targetpw/g' /etc/sudoers
sed -i 's/# ALL ALL=(ALL) ALL/ALL ALL=(ALL) ALL/g' /etc/sudoers

Create your user:

echo "johnex:p:16666:0:99999:7:::" >> /etc/shadow
echo "johnex:x:1000:1000:johnex:/home/johnex:/bin/ash" >> /etc/passwd
passwd johnex

Create group:

echo "sudo:x:27:johnex" >> /etc/group
echo "johnex:x:1000:" >> /etc/group

Create home directory:

mkdir -p /home/johnex
chown johnex /home/johnex

Disable Root SSH access:

sed -i "s/option RootPasswordAuth 'on'/option RootPasswordAuth 'off'/g" /etc/config/dropbear
5 Likes