Changes

no edit summary
Line 25: Line 25:  
===CLI===
 
===CLI===
 
----
 
----
CLI can be reached through the router's WebUI. To reach the router's WebUI, simply enter the router's LAN IP address ('''192.168.1.1''' by default) into your browser's URL bar and press "Enter". Next, type in the router's login information (user name: '''admin'''; password: '''admin01''' by default) and click "Login":
+
* CLI can be reached through the router's WebUI. To reach the router's WebUI, simply enter the router's LAN IP address ('''192.168.1.1''' by default) into your browser's URL bar and press "Enter". Next, type in the router's login information (user name: '''admin'''; password: '''admin01''' by default) and click "Login":
   −
[[File:Rut login page configuration examples version.png]]
+
[[File:Rut login page example.png|border|class=tlt-border]]
 
----
 
----
   −
Next, navigate to the '''[[RUT955_Services_section|Services]]''' menu and click on the '''CLI''' option from the drop-down list:
+
*Next, navigate to the '''System''' menu and click on the '''CLI''' option from the drop-down list:
   −
[[File:How to cli.png]]
+
[[File:CLI location.png|border|class=tlt-border]]
 
----
 
----
   −
In the next window, type in the user name '''root''' and press "Enter". Then type in the router's password (same one you used for logging in to the router), press "Enter" and you should be greeted with a window such as this:
+
* In the next window, type in the user name '''root''' and press "Enter". Then type in the router's password (same one you used for logging in to the router), press "Enter" and you should be greeted with a window such as this:
   −
[[File:Cli rutos.PNG]]
+
[[File:CLI rutos v4.png|border|class=tlt-border]]
    
Once this is done, you will able to execute commands via CLI.
 
Once this is done, you will able to execute commands via CLI.
Line 43: Line 43:  
===SSH===
 
===SSH===
 
----
 
----
To login to a RUTxxx router via SSH, download the free '''PuTTY''' app if you're using Windows; if you're using a Linux based OS, just use the '''Terminal''' app. In both cases you will need to know three things: the router's LAN IP address, user name and password. The default LAN IP address for all RUTxxx routers is '''192.168.1.1'''; the default login information is user name: '''root'''; password: '''admin01''' (NOTE: the user name used for SSH connections (i.e., root) is not the same as the user name used to login to the router's WebUI (i.e., admin)).
+
If you are using a Windows OS, you can use the free '''PuTTY''' app to login to a RUTxxx router via SSH; if you're using a Linux based OS, just use the '''Terminal''' app. In both cases you will need to know three things: the router's LAN IP address, user name and password. The default LAN IP address for all RUTxxx routers is '''192.168.1.1'''; the default login information is user name: '''root'''; password: '''admin01''' (NOTE: the user name used for SSH connections (i.e., root) is not the same as the user name used to login to the router's WebUI (i.e., admin)).
 +
----
 +
* '''Linux''': open PuTTY; enter the router's LAN IP address into the '''Host Name (or IP address)''' field, specify '''port 22''', select SSH Connection type and click '''Open''':
   −
If you're using PuTTY, enter the router's LAN IP address into the '''Host Name (or IP address)''' field, select SSH Connection type and click '''Open''':
+
[[File:Putty login 1 v2.PNG]]
 +
----
 +
* In the next window type in the user name, press "Enter", type in the router's admin password and press "Enter" again. You should be greeted with a message such as this:
   −
[[File:Putty login 1.PNG]]
+
[[File:Putty login v3.png|alt=]]
   −
After this you will be prompted to enter the user name and password.  
+
Once this is done, you will able to execute commands via SSH.
 
----
 
----
If you're using Linux, open up a new Terminal and type in this command:
+
* '''Linux''': open a new Terminal window, type '''ssh [email protected]''' and press "Enter". If this is your first time logging in, you might be asked to clarify whether you really want to login. In that case, just type '''yes''' and press "Enter". Then type in the router's admin password and press "Enter" to finish the login process:  
 
  −  −
 
  −
If you made changes to your router's LAN IP address or login name, replace the relevant data in the command above so that it is correct for your specific case. After executing this command you will prompted with a query that says "Are you sure you want to continue connecting (yes/no)?". Type '''yes''', press "Enter" and type in your router's admin password. If everything went successfully, you should be greeted with a window such as this:
     −
[[File:Ssh login example.png]]
+
[[File:SSH linux login v3.png|alt=]]
    
Once this is done, you will able to execute commands via SSH.
 
Once this is done, you will able to execute commands via SSH.
Line 71: Line 71:  
This method is useful when sending short emails. As an example, lets send an email containing the message "'''Hello, JustTesting'''", from the hypothetical address '''[email protected]''' to '''[email protected]''' using Gmail's SMTP settings:
 
This method is useful when sending short emails. As an example, lets send an email containing the message "'''Hello, JustTesting'''", from the hypothetical address '''[email protected]''' to '''[email protected]''' using Gmail's SMTP settings:
   −
  :~# echo -e "subject:Test\nfrom:[email protected]\nHello,\n\nJustTesting" | sendmail -v -H "exec openssl s_client -quiet -connect smtp.gmail.com:587 -tls1 -starttls smtp" -f [email protected] au"[email protected]" -ap"senders.email.password" [email protected]
+
  :~# echo -e "subject:Test\nfrom:[email protected]\nHello,\n\nJustTesting" | sendmail -v -H "exec openssl s_client -quiet -connect smtp.gmail.com:587 -tls1 -starttls smtp" -f [email protected] -au"[email protected]" -ap"senders.email.password" [email protected]
    
Let's examine this command in detail. First, this part:
 
Let's examine this command in detail. First, this part:
Line 92: Line 92:  
So in short, the part beginning with '''echo''' and ending just before the column ('''|''') represents the email's header and body of text. Now lets examine the next part (the one that begins after the column):
 
So in short, the part beginning with '''echo''' and ending just before the column ('''|''') represents the email's header and body of text. Now lets examine the next part (the one that begins after the column):
   −
'''sendmail <span style=color:green>-v -H</span> "<span style=color:blue>exec openssl s_client -quiet -connect smtp.gmail.com:587 -tls1 -starttls smtp</span>" <span style=color:red>-f [email protected]</span> <span style=color:purple>-au"[email protected]" -ap"senders.email.password"</span> <span style=color:brown>[email protected]</span>'''
+
'''sendmail <span style=color:green>-v -H</span> "<span style=color:blue>exec openssl s_client -quiet -connect smtp.gmail.com:587 -tls1 -starttls smtp</span>" <span style=color:red>-f [email protected]</span> <span style=color:purple>-au"[email protected]" -ap"senders.email.password"</span> <span style=color:brown> [email protected]</span>'''
    
* <span style=color:green>'''-v'''</span> - verbose mode
 
* <span style=color:green>'''-v'''</span> - verbose mode
Line 109: Line 109:  
This next method is superior when sending longer messages. Instead of using the echo command, we'll store our email header and body information into a text file. Just as in the example above, let's send an email from the hypothetical address '''[email protected]''' to '''[email protected]''' using Gmail's SMTP settings, but without using echo:
 
This next method is superior when sending longer messages. Instead of using the echo command, we'll store our email header and body information into a text file. Just as in the example above, let's send an email from the hypothetical address '''[email protected]''' to '''[email protected]''' using Gmail's SMTP settings, but without using echo:
   −
  :~# sendmail -v -H "exec openssl s_client -quiet -connect smtp.gmail.com:587 -tls1 -starttls smtp" <span style=color:red>'''</tmp/mail.txt'''</span> -f [email protected] -au"[email protected]" -ap"pass"[email protected]
+
  :~# sendmail -v -H "exec openssl s_client -quiet -connect smtp.gmail.com:587 -tls1 -starttls smtp" <span style=color:red>'''</tmp/mail.txt'''</span> -f [email protected] -au"[email protected]" -ap"pass" [email protected]
    
As you can see, instead of echo, we're using <span style=color:red>'''</tmp/mail.txt'''</span>, which is the path to the '''mail.txt''' file that stores the email's header and body. This file does not exist in the router, therefore, you should create it yourself. To create a file, use the '''touch''' command:
 
As you can see, instead of echo, we're using <span style=color:red>'''</tmp/mail.txt'''</span>, which is the path to the '''mail.txt''' file that stores the email's header and body. This file does not exist in the router, therefore, you should create it yourself. To create a file, use the '''touch''' command:
Line 135: Line 135:  
==External links==
 
==External links==
   −
'''https://www.putty.org/''' - PuTTY download
+
* '''https://www.putty.org/''' - PuTTY downloads page
 +
* '''https://wiki.teltonika-networks.com/view/Sending_emails_via_command_line_RutOS''' - Guide for RutOS firmware
 +
[[Category:Email]]

Navigation menu