13. NLOAD
You can see your network load with nload.
This is for a DSL 2000 (2000kbit/sec down- 256kbit/sec upstream):
Code:
nload -t 200 -s 7 -i 2048 -o 256 -u H eth1
14. Adjust profile
To make life easier at the command promt you will add some alias.
Code:
vi /opt/etc/profile
The file should be executable (chmod ...).
The content (Edit the nload settings!):
# Some alias for making life easier
# To start nload with DSL 6000 settings: 'nld'
alias nld="nload -t 200 -s 7 -i 6656 -o 640 -u H eth1"
# Make ls default -la with color coding
alias ls="ls --color=auto -la"
# Make pss a grep ps function
alias pss="ps axf | grep"
# df human readable (Only works with coreutils installed!)
# alias df="df -h"
There is one more line if you installed midnight commander.
Make it executable:
Code:
chmod +x /opt/etc/profile
Save, reboot:
Code:
flashfs save && flashfs commit && flashfs enable && reboot
You can verify your modification by entering 'alias':
[admin@blechbuechse root]$ alias
ls='ls --color=auto -la'
nld='nload -t 200 -s 7 -i 6656 -o 640 -u H eth1'
pss='ps axf | grep'
15. Automate SSH login
Until now you need to insert user and password for every ssh login. I assume you are as lazy as i am. So we will do this with keys.
First you need to create a pair of keys. For Windows this is done with PuttyGen.
Start, press generate and move your mouse until the key is generated.
The field "Key comment" is used to identify the keys, if there are more than one. Insert your name here.
Save the private key as file:
You can save your private key with a passphrase. This is for security reasons. Enter a passphrase.
Press "Save private Key" and save your private key to a file. (e.g. C:\keys\mykey.ppk)
Save the public key on the Asus:
Copy the content of the upper, grey field to the clipboard. The key shold look like this:
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAn+NorNZlb9xhogR2DfNq6R qRg04KKXm2t4WIxj/0NWxjOVUAg4fFl2diA+3+f7gjIPdyEJnGUhkfgckYqhfMoZswr TjtvjP00p5O/LPcvGxzpy0XOBty1NQjcYOrOMC6BFrp6Rh0cVThF+sdAYXogn6 w49GOoSvKdgcTLCDubyM= testkey
YOUR KEY SHOULD LOOK DIFFERENT! THIS IS ONLY AN EXAMPLE.
You need a special directory to store your public key in. This is in the root/admin home directory:
Code:
mkdir /usr/local/root/.ssh
Edit the file
Code:
vi /usr/local/root/.ssh/authorized_keys
and insert the content of your clipboard. One line per key, no line feeds!
Multiple keys can be inserted here and are seperated by a new line. One line for each key.
This part of the filesystem is in the flash so you have to save it:
Code:
flashfs save && flashfs commit && flashfs enable && reboot
Next step is to tell putty to use the key:
Configure putty:
"Connection - Data" bei "Auto-login username" enter the username: admin
"Connection - SSH - Auth" at "Private key file for authentication" Enter the file saved in the above step (e.g. C:\keys\mykey.ppk)
Do not forget to save (Session - Save)
Your login should look like this now:
Using username "admin".
Authenticating with public key "testkey"
[admin@blechbuechse root]$
Optional: Disable login with passwort
The option "dropbear -s" disables login with password. Only login with keys will be possible!
Edit /usr/local/sbin/post-boot to modify the option for start.
Insert a "-s" directly behind dropbear.
ATTENTION: If you loose your key you are locked out! Use this with care!
Do not forget to save and reboot.
16. Open SSH port to Internet (if directly connected)
You have to open port 22 in your firewall to connect to your router over internet. If your Asus is directly connected to the internet and in home gateway mode you can do this directly. The firewall is iptables.
Remark: This is a security risk! Be sure to set at least a strong password for your users!!! Have a look at THIS for a secure sshd config.
Edit your /usr/local/sbin/post-firewall and insert:
Code:
#!/bin/sh
# this opens the ssh port to internet! Be sure to have strong passwords!
iptables -I INPUT -m tcp -p tcp --dport 22 -j ACCEPT
And don't forget to save!
Hint: The iptables command above can also be used to open other ports.