Completely Lost Trying To Use PuTTY

Since I cannot find a tutorial detailing how to implement via LuCI the OpenWrt Project Routed Client (https://openwrt.org/docs/guide-user/network/routedclient) on a WRT1900ACS I am going down the PuTTY route...

...but am completely lost.

I have copied and pasted a few test commands from various sources. Some work, but 99% don't.

For instance, this command (which, ostensibly removes the firewall) doesn't work --

root@LEDE:~# chmod 644 /etc/init.d/S45firewall
chmod: /etc/init.d/S45firewall: No such file or directory

or this which is supposed to set the host name of the router

root@LEDE:~# nvram set wan_hostname=MyWrt
-ash: nvram: not found

However this command --
root@LEDE:~# uci del wireless.@wifi-device[0].disabled
root@LEDE:~#
appears to be accepted.

Evidently, according to the OpenWrt Project: Command line interpreter page (https://openwrt.org/docs/guide-user/base-system/user.beginner.cli) I need to integrate some sort of text editor into PuTTY. How do I do that? What editors are forum favorites?

On the OpenWrt Project Routed Client page (https://openwrt.org/docs/guide-user/network/routedclient) it states --

Step 1: Change the WAN interface

Edit /etc/config/network and change the WAN interface by editing the existing ifname option:

config 'interface' 'wan' option 'proto' 'dhcp'

OK, fine, but how do I open and edit /etc/config/network?

Could someone give me a basic step by step example on how to integrate an editor into PuTTY and edit the file /etc/config/network?

This might get me started as I can find no relevant examples in the PuTTY User Manual (http://the.earth.li/~sgtatham/putty/0.63/htmldoc/),

I have looked around for a step-by-step with explicit examples (as opposed to saying, well, you do this and that) primer on how to use PuTTY but no luck. Does anyone have a link to a decent tutorial?

Use WinSCP.

2 Likes

Umm, you don't need to integrate anything into putty. Putty is just a terminal (keyboard for input and screen for display)

As far as using a editor VI is builtin to openwrt but it is advanced so maybe find some online tutorial
before you use it.
eg
vi /etc/config/network

NANO is popular and easier to use but not builtin. So will need to use opkg first to install it.

opkg update
opkg install nano
nano /etc/config/network

OH, and before you go cutting and pasting commands be careful, for example chmod does not delete a file it changes the permissions, so maybe lookup a tutorial for ASH or BASH
Some hints
COMMAND | DESCRIPTION
ls list the files in a directory
rm delete a file
cd change directory
pwd print path of current directory

2 Likes

You have connected to the router so you already know everything you need about how to use putty. If you want to understand what you are doing you now need to learn how use the command line on a Linux server, which is what OpenWrt is. If not you should use the web GUI, because it's very easy to break something you won't be able to fix when you use the command line.

These commands stir dusty memories of the WRT54G days and how OpenWRT worked a decade ago. You might want to check if those "various sources" are current.

1 Like

The hostname of the router is set here:

/etc/config/system

config system
	option hostname 'OpenWrt'

When connecting to the terminal, you acces this using the command:

vi /etc/config/system

  • Hit the INSERT button
  • Navigate to the word "OpenWrt"
  • Edit within the quotation marks
  • When done, hit the INSERT button again
  • Hit the colon (: ) button
  • Type wq to save the file and exit

vi /etc/config/network

Use the same procedure to begin editing, end editing, and save/exit, as noted above.

2 Likes

vi is not for everyone...
If you feel unconfortable with vi, use nano, as written above by mbo2o .

3 Likes

Thank you everyone. I think I get the idea here.

  1. I need to learn the Linux command line.
  2. I need to learn how to use vi or download some other text editor software into my OpenWrt router and learn that.

Am I missing anything? Thanks for your patience.

3 Likes

Thank you for the tip.