PdaXrom: Networking with Linux
From OESF
(→Secure FTP) |
m |
||
(4 intermediate revisions not shown.) | |||
Line 1: |
Line 1: | ||
| + | [[Networking]] > PdaXrom: Networking with Linux | ||
| + | |||
| + | ---- | ||
| + | |||
This guide discusses how to establish an internet connection over a USB cable (TCP/IP over USB) with a linux PC. | This guide discusses how to establish an internet connection over a USB cable (TCP/IP over USB) with a linux PC. | ||
Line 153: |
Line 157: | ||
<tt>ssh username@192.168.129.200</tt> | <tt>ssh username@192.168.129.200</tt> | ||
where username is your login ID. Also note that you have to have an SSH server running on your PC. | where username is your login ID. Also note that you have to have an SSH server running on your PC. | ||
| + | |||
| + | ==== Dynamic Forwarding ==== | ||
| + | |||
| + | Using Zaurus as a SOCKS proxy for your PC to use: | ||
| + | |||
| + | First open a terminal on the Zaurus, then run <tt>ssh -D 1080 username@pc_computer</tt>. Next set up proxy settings in PC browser: ie) Manual proxy settings, SOCKS 5, zaurus IP, port 1080. That's all there is to it. | ||
=== Secure FTP === | === Secure FTP === | ||
Line 170: |
Line 180: | ||
Listing and changing directories: | Listing and changing directories: | ||
ls and cd | ls and cd | ||
| + | |||
| + | === Secure Copy SCP === | ||
| + | [http://sdf.lonestar.org/index.cgi?tutorials/filetransfer#scp Secure Copy Notes] Secure copy is a nice way to send a signle file quickly from your Zaurus to another computer. | ||
=== Graphical SFTP === | === Graphical SFTP === | ||
Now here's a nice way to transfer files, if you are running KDE on your desktop. (I'm using KDE 3.5.1, BTW, but I expect it works in earlier versions.) Run <tt>konqueror</tt>. If you wish, you can go to <tt>Network Folders</tt> and <tt>Add a Network Folder</tt>, or you can just type in <tt>fish://root@192.168.129.201</tt> into the location bar. It asks for your password, and then you can use it like any other konqueror window. How slick is that? | Now here's a nice way to transfer files, if you are running KDE on your desktop. (I'm using KDE 3.5.1, BTW, but I expect it works in earlier versions.) Run <tt>konqueror</tt>. If you wish, you can go to <tt>Network Folders</tt> and <tt>Add a Network Folder</tt>, or you can just type in <tt>fish://root@192.168.129.201</tt> into the location bar. It asks for your password, and then you can use it like any other konqueror window. How slick is that? | ||
| - | |||
| - | |||
| - | |||
== See Also == | == See Also == | ||
Current revision
Networking > PdaXrom: Networking with Linux
This guide discusses how to establish an internet connection over a USB cable (TCP/IP over USB) with a linux PC.
Contents |
Before You Begin
You will need
- A PC running linux with a recent kernel
- A Zaurus
- A cable/stand to connect the two
These instructions have been tested with:
- Kubuntu 5.10 with a 2.6.12-10 kernel, and a Sharp Zaurus SL-C1000 with pdaXrom 1.1.0beta1.
- If it worked on your machine, add an entry here
Does Your Computer Detect the Zaurus
On your Z, run "USB" (which is found with the "System Tools" applications. Choose the Network radio button, and make sure that the values are the default:
IP: 192.168.129.201 Netmask: 255.255.255.0 Gateway: [empty] DNS: [empty]
Press OK.
Now, plug your Zaurus into the appropriate cable and into the PC. For a C1000, the cable is a mini USB cable. [I believe that for older models, your put the Z into its cradle and connect that to the PC.]
On your PC, in a terminal, run tail /var/log/messages . You should see something like one of the following:
Output on Kubuntu 5.10 with 2.6.12-10 kernel.
user@desktop:~$ tail /var/log/messages Mar 22 05:43:13 localhost kernel: [4378213.648000] usbcore: registered new driver usbnet Mar 22 05:43:13 localhost usb.agent[12069]: usbnet: loaded successfully
Output on Debian unstable with 2.6.14-2 kernel connecting to OpenZaurus, not pdaXrom'.
user@desktop:~# tail /var/log/messages Dec 17 17:35:58 localhost kernel: usb 2-2: new full speed USB device using uhci_hcd and address 10 Dec 17 17:35:58 localhost kernel: usb0: register 'zaurus' at usb-0000:00:10.0-2, pseudo-MDLM (BLAN) device, 52:8c:8b:4f:e4:90
The Debian guide says to find that the module was loaded:
user@desktop:~# lsmod | grep zaurus usbnet 17064 2 zaurus,cdc_ether
I got no results doing this. However, searching for usbnet gave me this:
blackmore@death:~$ lsmod | grep usbnet usbnet 34824 0 usbcore 118396 6 usbnet,usb_storage,usbhid,ehci_hcd,uhci_hcd mii 5760 3 usbnet,8139too,8139cp
Setting up the Usb0 Interface
Next, run ifconfig -a. [Note that the "if" in commands like this that start with it, stands for "network InterFace."] You should see an unconfigured usb0 module.
user@desktop:~$ ifconfig -a
... lines removed ...
usb0 Link encap:Ethernet HWaddr 1E:57:BF:FA:33:4D
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
If this is the case, you can now establish a connect. On your Linux PC, issue this command:
sudo ifconfig usb0 192.168.129.200 netmask 255.255.255.0 mtu 576 up
Note that this IP ends in 200, while the IP we set on the Zaurus ends in 201.
Now you can run netstat -r to see a routing table.
user@desktop:~$ netstat -r Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 192.168.129.0 * 255.255.255.0 U 0 0 0 usb0 XX.XX.XXX.0 * 255.255.255.0 U 0 0 0 eth0 default XX.XX.XXX.1 0.0.0.0 UG 0 0 0 eth0
The first line shows the usb0 device. This is a good thing.
If you issue the same command on your Zaurus, you'll get:
# netstat -r Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 192.168.129.0 * 255.255.255.0 U 40 0 0 usbd0
Ping to See Them Communicate
Now we can try pinging the Zaurus from the PC:
user@desktop:~$ ping 192.168.129.201 PING 192.168.129.201 (192.168.129.201) 56(84) bytes of data. 64 bytes from 192.168.129.201: icmp_seq=1 ttl=64 time=3.05 ms 64 bytes from 192.168.129.201: icmp_seq=2 ttl=64 time=1.13 ms 64 bytes from 192.168.129.201: icmp_seq=3 ttl=64 time=1.67 ms 64 bytes from 192.168.129.201: icmp_seq=4 ttl=64 time=2.10 ms 64 bytes from 192.168.129.201: icmp_seq=5 ttl=64 time=1.26 ms 64 bytes from 192.168.129.201: icmp_seq=6 ttl=64 time=1.04 ms --- 192.168.129.201 ping statistics --- 6 packets transmitted, 6 received, 0% packet loss, time 5025ms rtt min/avg/max/mdev = 1.041/1.710/3.054/0.702 ms
You should get similar results by running ping 192.168.129.200 on your Zaurus.
Make The Connection Permanent
The next steps discuss how to make this connection permanent. Until this page is finished, please see the link below.
Now What
Setting a Root Password
Many of the really cool things we want to do require that you set a password on your Zaurus. If you don't, you can not log in remotely.
Open a console on your Z and run
passwd
You'll be asked for a password, and to confirm it. Remember this password, though, for you'll need it the next time you reboot your Z!
Secure Shell
The Secure Shell is like telnet, but safer. It lets you have remotely log in to a computer, and run command line programs.
From the PC to the Z
If your Z has a root password (see above), you can issue this command on your PC: ssh root@192.168.129.201
Now you are logged in remotely and can do anything you want from the command line.
From the Z to the PC
To go the other way, on your Z, issue this command: ssh username@192.168.129.200 where username is your login ID. Also note that you have to have an SSH server running on your PC.
Dynamic Forwarding
Using Zaurus as a SOCKS proxy for your PC to use:
First open a terminal on the Zaurus, then run ssh -D 1080 username@pc_computer. Next set up proxy settings in PC browser: ie) Manual proxy settings, SOCKS 5, zaurus IP, port 1080. That's all there is to it.
Secure FTP
Secure FTP is FTP over ssh. The commands are exactly the same as above, but you use sftp in place of ssh.
Using a different port:
sftp -oPort=222 username@remote_computer
Downloading
get /Path/To/File.jpg /save/file/here ie) get ~/notes.txt /mnt/card/notes.txt
Uploading
put /source/of/file /destination/of/file
Listing and changing directories:
ls and cd
Secure Copy SCP
Secure Copy Notes Secure copy is a nice way to send a signle file quickly from your Zaurus to another computer.
Graphical SFTP
Now here's a nice way to transfer files, if you are running KDE on your desktop. (I'm using KDE 3.5.1, BTW, but I expect it works in earlier versions.) Run konqueror. If you wish, you can go to Network Folders and Add a Network Folder, or you can just type in fish://root@192.168.129.201 into the location bar. It asks for your password, and then you can use it like any other konqueror window. How slick is that?
See Also
- Debian unstable Zaurus USB-network how-to - for connecting with a Zaurus running OpenZaurus
- Linux Kernel 2.6.14 Breaks Usbnet Xfer From Zaurus
- Running X Over The Network (Using a PC to control a Zaurus)
Up to pdaXrom main page.

