Securing OpenWRT
Enabling HTTPS:
Install Required Packages:
opkg update
opkg install luci-lib-px5g px5g-standalone libustream-openssl luci-ssl
opkg install luci2. Restart httpd server
/etc/init.d/uhttpd restartThis will generate the certificate:
about to generate keys
Generating RSA private key, 2048 bit long modulus
Generating selfsigned certificate with subject 'C=ZZ;ST=Somewhere;L=Unknown;CN=OpenWrt;' and validity 2016-09-19 19:52:32-2018-09-19 21:59:32
keys generatedOptionally remove the key generator:
opkg remove px5g3. Disable or rebind router listening on plain HTTP:
Disable:
uci delete uhttpd.main.listen_http ; uci commitOr rebind all
LANconnections to redirectHTTPtoHTTPS
Restart
HTTPD
This should be reachable via HTTPS now. Done!
Setting up the root password:
LuCI
Navigate to
LuCI-->System-->Administration-->Router PasswordEnter new password
Click
Save & Apply
CLI
Done!
SSH Access:
Do not offer access from the Internet at all
Create a non-privaleged user:
Add user:
Change user
password:
Create user
home:
Add entry:
Add user to
sudo:
Install sudo:
Modify sudoers file to use sudo with root password prompt:
or
Uncomment the following lines:
This method is more secure because you don't need to protect both root and privileged (sudoer) users to keep the whole system safe.
Add
SSHKey to newUser:
Add Public Key to file
Modify Port & Authentication
Navigate to
System-->AdministrationClick on
SSH AccessChange
PortDisable
Password authenticationDisable
Allow root logins with passwordSave & Apply
Done!
Disable IPV6:
Last updated