Changes

no edit summary
Line 27: Line 27:  
* 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 locate cli v2.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 v3.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 51: Line 51:  
* 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:
 
* 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 2 v2.PNG]]
+
[[File:Putty 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 57: Line 57:  
* '''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:  
 
* '''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:  
   −
[[File:Ssh linux login v2.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 page
+
* '''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