WinSCP

From DD-WRT Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 23:34, 15 January 2008 (edit)
Soulstace (Talk | contribs)
(WinSCP supports public key authentication)
← Previous diff
Current revision (04:58, 11 November 2010) (edit) (undo)
Telcom (Talk | contribs)
m (Uses and Warnings)
 
(15 intermediate revisions not shown.)
Line 1: Line 1:
 +==Introduction==
For Windows XP (or other varients), this article is just an explanation on how to use WinSCP to transfer files and manage folders on the writable storage areas within the router. A lot of articles refer to using WinSCP in the DD-WRT Wiki, however few go into any detail, assuming instead the user knows how to use WinSCP or even what it is. For Windows XP (or other varients), this article is just an explanation on how to use WinSCP to transfer files and manage folders on the writable storage areas within the router. A lot of articles refer to using WinSCP in the DD-WRT Wiki, however few go into any detail, assuming instead the user knows how to use WinSCP or even what it is.
WinSCP gives a norton-commander like interface for transferring files and creating folders on the router. WinSCP gives a norton-commander like interface for transferring files and creating folders on the router.
-# Enable SSH in the Web administration page of the router. The default port of 22 is fine. Enable password and/or Public Key authentication.+==Getting Started Guide==
-# Download WinSCP from [[http://www.winscp.net]] and install it.+# Enable [[Telnet/SSH and the Command Line#SSH|SSH]] in the Web administration page of the router.
-# Host name: Router's IP address. User name: Always 'root', even if you have changed the username for the web interface. Password: router password. Private key file: your private key (only if you wish to use public key authentication). File Protocol: SCP, '''not SFTP'''.+# Download [http://www.winscp.net WinSCP] and install it.
 +# Launch the program. Under Session, enter:
 +#* Host name: Router's IP address
 +#* User name: Always 'root'. Even if you have changed the username for the web interface.
 +#* Password: router password
 +#* Optional: Private key file: Only if you are using private/public key authentication, instead of the router username/password. See [[Telnet/SSH_and_the_Command_Line#Public_key_method|Public Key authentication]]
 +#* File Protocol: SCP, '''not SFTP'''
# You can save the session now for later use. # You can save the session now for later use.
-# When connecting there is a 'command 'groups' ' error and possibly a 'pwd' error. Ignore these.+# When connecting there is a 'command 'groups' ' error and possibly a 'pwd' error. Ignore these. *
# Then the window appears of the file manager. Local content is on the left, router content on the right. # Then the window appears of the file manager. Local content is on the left, router content on the right.
-WinSCP can be used to save information on the DD-WRT-enabled router in /jffs, if you have JFFS turned on and there is any space left in the flash. Or WinSCP can save to the SD Card, mounted in /mmc, or other attached storage mounted in the DD-WRT file system.+<nowiki>*</nowiki> To get rid of this annoying warnings add this to your startup script:
 + export PATH=/tmp/bin:\$PATH
 + echo > /tmp/bin/groups "#!/bin/sh
 + echo 'root'"
 + /bin/chmod +x /tmp/bin/groups
-Windows and DOS platforms only, use Carriage Return and New Line codes at the end of each line, within text files. Unix only uses New Line. The difference is between text files generated or edited on a Windows platform, and Unix (and almost all other operating systems are similar to Unix, not Windows). Editing of a script file on an SD Card plugged directly into a card reader on a PC with Windows, must use a special editor to create or modify the script or text file, like jedit, or unix2dos and dos2unix utility to convert the file.+==Uses and Warnings==
 +* WinSCP can be used to save information on the DD-WRT-enabled device on any rw-able space. This is normally /jffs, /mmc or /mnt, /opt
-Bonus: Transfer files with WinSCP and text is automatically converted. And besides, it's more convenient than a sneakernet.+rw-space has to be enabled first. See: [[Jffs]] for /jffs, see [[SD/MMC_mod|SD Card Modification]] for /mmc, and [[USB_storage]] for /mnt. Also see [[optware]] for /opt in connection with jffs, sd card or usb
 + 
 +'''About editing scripts on a Microsoft's Windows platform''': ''Do Not use Notepad'' to write or edit the script files - it messes up the <line break> linux codes. WinSCP has a built-in editor which formats correctly for Unix.
 + 
 +The following applications can also save Unix-formatted files:
 +* [http://notepad-plus.sourceforge.net/ Notepad++]
 +* jedit
 +* [http://www.editpadpro.com EditPadLite] Free version of EditPadPro
 +* or unix2dos and dos2unix utility to convert the file.
 +* Has this been tested?: [http://en.wikipedia.org/wiki/Programmer%27s_Notepad Programmer's Notepad]
 +* UltraEdit from [http://www.ultraedit.com/products/ultraedit.html IDM Computer Solutions, Inc.] This has been tested.
 +Microsoft platforms use Carriage Return and New Line codes at the end of each line, within text files. Unix only uses New Line, and almost all other operating systems are similar to Unix, not Windows.
 + 
 +export PATH=/tmp/bin:\$PATH
 +echo > /tmp/bin/groups "#!/bin/sh
 +echo 'root'"
 +/bin/chmod +x /tmp/bin/groups
 + 
 +==Use WinSCP to automatically mirror PC files to a DD-WRT Device==
 +Edit html files locally with your favorite website editor (Dreamweaver or SeaMonkey), and have WinSCP update the DD-WRT device copies automatically.
 + 
 +While connected to the router with WinSCP,
 +# Manually drag the content on the right to the left.<br>Creates a copy of the folder or files on your computer of the folder on the router.
 +# Click on the left side, then choose, Keep Remote Directory Up To Date...
 +# Click once on Sycronize on Start (unchecked).
 +# Click Start.
 +# WinSCP updates the information on the router whenever the mirror on the local computer is modified (I.E. Saved in Dreamweaver).
 + 
 + 
 +[[Category:Management]]
 +[[Category:Basic tutorials]]

Current revision

Contents

[edit] Introduction

For Windows XP (or other varients), this article is just an explanation on how to use WinSCP to transfer files and manage folders on the writable storage areas within the router. A lot of articles refer to using WinSCP in the DD-WRT Wiki, however few go into any detail, assuming instead the user knows how to use WinSCP or even what it is.

WinSCP gives a norton-commander like interface for transferring files and creating folders on the router.

[edit] Getting Started Guide

  1. Enable SSH in the Web administration page of the router.
  2. Download WinSCP and install it.
  3. Launch the program. Under Session, enter:
    • Host name: Router's IP address
    • User name: Always 'root'. Even if you have changed the username for the web interface.
    • Password: router password
    • Optional: Private key file: Only if you are using private/public key authentication, instead of the router username/password. See Public Key authentication
    • File Protocol: SCP, not SFTP
  4. You can save the session now for later use.
  5. When connecting there is a 'command 'groups' ' error and possibly a 'pwd' error. Ignore these. *
  6. Then the window appears of the file manager. Local content is on the left, router content on the right.

* To get rid of this annoying warnings add this to your startup script:

export PATH=/tmp/bin:\$PATH
echo > /tmp/bin/groups "#!/bin/sh 
echo 'root'" 
/bin/chmod +x /tmp/bin/groups

[edit] Uses and Warnings

  • WinSCP can be used to save information on the DD-WRT-enabled device on any rw-able space. This is normally /jffs, /mmc or /mnt, /opt

rw-space has to be enabled first. See: Jffs for /jffs, see SD Card Modification for /mmc, and USB_storage for /mnt. Also see optware for /opt in connection with jffs, sd card or usb

About editing scripts on a Microsoft's Windows platform: Do Not use Notepad to write or edit the script files - it messes up the <line break> linux codes. WinSCP has a built-in editor which formats correctly for Unix.

The following applications can also save Unix-formatted files:

Microsoft platforms use Carriage Return and New Line codes at the end of each line, within text files. Unix only uses New Line, and almost all other operating systems are similar to Unix, not Windows.

export PATH=/tmp/bin:\$PATH echo > /tmp/bin/groups "#!/bin/sh echo 'root'" /bin/chmod +x /tmp/bin/groups

[edit] Use WinSCP to automatically mirror PC files to a DD-WRT Device

Edit html files locally with your favorite website editor (Dreamweaver or SeaMonkey), and have WinSCP update the DD-WRT device copies automatically.

While connected to the router with WinSCP,

  1. Manually drag the content on the right to the left.
    Creates a copy of the folder or files on your computer of the folder on the router.
  2. Click on the left side, then choose, Keep Remote Directory Up To Date...
  3. Click once on Sycronize on Start (unchecked).
  4. Click Start.
  5. WinSCP updates the information on the router whenever the mirror on the local computer is modified (I.E. Saved in Dreamweaver).