Talk:Telnet/SSH and the command line

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 16:00, 15 October 2008 (edit)
HKK (Talk | contribs)
(Alternative for ls on micro builds)
← Previous diff
Revision as of 17:00, 15 October 2008 (edit) (undo)
HKK (Talk | contribs)
(Alternative for ls on micro builds)
Next diff →
Line 33: Line 33:
Maybe someone who knows about it (i.e. development team) should include the differences in the commands included with each version. For example, I just had to find out via forum search that the ''micro'' build does not even include the ls command (!!!). (What's more, I haven't found some kind of directory listing either, so I have no idea what is where on the router's fs >.<).<br> I can understand if some commands have to be left out due to space issues, but for working with the CLI, the ls would be rather important, or it would at least be nice to have known before that it isn't present at all.<br>--[[User:HKK|HKK]] 13:01, 15 October 2008 (CEST) Maybe someone who knows about it (i.e. development team) should include the differences in the commands included with each version. For example, I just had to find out via forum search that the ''micro'' build does not even include the ls command (!!!). (What's more, I haven't found some kind of directory listing either, so I have no idea what is where on the router's fs >.<).<br> I can understand if some commands have to be left out due to space issues, but for working with the CLI, the ls would be rather important, or it would at least be nice to have known before that it isn't present at all.<br>--[[User:HKK|HKK]] 13:01, 15 October 2008 (CEST)
-== Alternative for ls on micro builds ==+== Alternatives for ls on micro builds ==
As I posted on this talk page before, the micro build of DD-WRT lacks the essential <code>ls</code> command. Thus you have no way of looking around on the file system.<br> As I posted on this talk page before, the micro build of DD-WRT lacks the essential <code>ls</code> command. Thus you have no way of looking around on the file system.<br>
 +
 +===Use grep===
I just found a very basic substitute, but nevertheless at least you see ''some''thing. The trick is to 'abuse' the <code>grep</code> command which is actually used to filter the content of files/program output for a certain search word or regular expression. By looking for a random letter (doesn't matter which one) and only letting it display the count of hits (<code>-c</code> option). By limiting the number of maximum hits per file to zero (<code>-m 0</code>) you can increase search time.<br> I just found a very basic substitute, but nevertheless at least you see ''some''thing. The trick is to 'abuse' the <code>grep</code> command which is actually used to filter the content of files/program output for a certain search word or regular expression. By looking for a random letter (doesn't matter which one) and only letting it display the count of hits (<code>-c</code> option). By limiting the number of maximum hits per file to zero (<code>-m 0</code>) you can increase search time.<br>
The whole command reads as follows: The whole command reads as follows:
Line 46: Line 48:
This alias probably gets erased upon router reboot. To make it persistent, you'll have to create a startup script. This alias probably gets erased upon router reboot. To make it persistent, you'll have to create a startup script.
---[[User:HKK|HKK]] 18:00, 15 October 2008 (CEST)+===Use echo===
 +After poking the forum via google some more (the forum search won't allow you to search for 'ls' -- to short >.>), I also stumbled over the possibility of using <code>echo</code>. The disadvantage is that it does not enter new lines after each item. It doesn't differ between directories and files either (just like grep), but it has no problems accessing all folders (even <code>/proc</code>) and it is faster than grep.<br>
 +The command is simply:
 + echo *
 + 
 +--[[User:HKK|HKK]] 19:00, 15 October 2008 (CEST)

Revision as of 17:00, 15 October 2008

I moved the non-English entries from the main page. Didn't want to lose them but I sure can't read it. AycheKay

Contents

Telnet

Telnet è un modo molto semplice per accedere alla Linea di comnda (Shell) del tuo WRT54G e configurare delle opzioni non acessibili dall'interfaccia web. Visto che le password e i comandi via telnet non sono criptati, è consigliabile utilizzare SSH (Secure Shell). SSH è l'ideale rimpiazzo di Telnet in termini di sicurezza nelle reti pubbliche e private.

Abilitare

  1. Attraverso l' Interfaccia Web, Amministrazione e poi Servizi
  2. Abilitare Telnet oppure SSH
  3. Salvare le impostazioni


What version?

What version of firmware does this require? I have a WRT54G v2.02.7, and I do not see anywhere to enable SSHD under the admin tab. I also cannot connect using putty with port 23. I can access the web interface, but I cannot get anywhere on the command line.


blast:
So write what is your Firmware Version. I cant understand it clear. I am with the latest version of the Firmware and it functions very proper i must admit. DD-WRT v23final from 25.12.2005, my router ist version 3.1 i also overclocked my CPU from 216MHz up to 226MHz wiht the use of Telnet and SSH.


To first poster: I don't know if it is still an issue, but it could be that you have the wrong build. As you can see in the file versions comparison table, the micro build does not include the SSH daemon.
Also, you wouldn't be able to connect to port 23 with Putty unless you change the connection method to Telnet (by default it is set to ssh).
--HKK 12:31, 15 October 2008 (CEST)


Generating keys with Linux

Run the following commands:

ssh-keygen -b 

Different commands in different versions

Maybe someone who knows about it (i.e. development team) should include the differences in the commands included with each version. For example, I just had to find out via forum search that the micro build does not even include the ls command (!!!). (What's more, I haven't found some kind of directory listing either, so I have no idea what is where on the router's fs >.<).
I can understand if some commands have to be left out due to space issues, but for working with the CLI, the ls would be rather important, or it would at least be nice to have known before that it isn't present at all.
--HKK 13:01, 15 October 2008 (CEST)

Alternatives for ls on micro builds

As I posted on this talk page before, the micro build of DD-WRT lacks the essential ls command. Thus you have no way of looking around on the file system.

Use grep

I just found a very basic substitute, but nevertheless at least you see something. The trick is to 'abuse' the grep command which is actually used to filter the content of files/program output for a certain search word or regular expression. By looking for a random letter (doesn't matter which one) and only letting it display the count of hits (-c option). By limiting the number of maximum hits per file to zero (-m 0) you can increase search time.
The whole command reads as follows:

grep -c x -m 0 *

Limitations:

  • Does not differ between directories and files (you'll have to try using cd if it is a directory)
  • Does not always work (it will not list the complete content of /proc, for example). I don't know where the problem lies here. It might simply be that some files are locked and grep blocks when it tries to access them.

If you want to, you can create an alias for ls this way:

alias ls="grep -c x -m 0 *"

This alias probably gets erased upon router reboot. To make it persistent, you'll have to create a startup script.

Use echo

After poking the forum via google some more (the forum search won't allow you to search for 'ls' -- to short >.>), I also stumbled over the possibility of using echo. The disadvantage is that it does not enter new lines after each item. It doesn't differ between directories and files either (just like grep), but it has no problems accessing all folders (even /proc) and it is faster than grep.
The command is simply:

echo *

--HKK 19:00, 15 October 2008 (CEST)