Sunday, March 27, 2011

File transfer to remote computers from Haiku machine.

In my last post, I talked about use of the poorman and RobinHood web servers to copy files from a Haiku box to other computers.
The poorman webserver "more or less" worked but I failed to get any action out of RobinHood. I followed the directions included in this post to Haikuware and even emailed the guy that wrote this but got no reply.
Actually, I had overlooked the file to be downloaded in this latter link as I had, mistakenly, assumed the guy was just commenting on how to more conveniently use RobinHood as a web server.
However, even after downloading it and expanding it in the /boot/home directory as directed, RobinHood would not start for me. The Robin Hood Web Server Console just output "Waiting for server to start".
Nevertheless, clicking on /boot/home/web/public/index.html opens a browser tab where the HaikuOS Server is displayed. However, clicking on the Explore button just opens an error box declaring that there was an error loading file:///files. Couldn't read a file://file.
Incidentally, there's a tutorial for using poorman right here so I'll go through that in some depth when I get a chance.
In the meantime, I did a lot of fiddling around with ssh and scp from Haiku to my Mac (running OS X 10.6.7), to my EeePC 901 running Ubuntu 10.10 and, with some more difficulty, to Dell Dimension 9200 running Windows 7 Ultimate.
1. To get the Mac client working, I only had to ensure that Remote Login was checked in System Preferences>>Sharing.
To connect using ssh I issued the command

ssh username@

in my Haiku terminal.
The first time, I was asked if I wanted to continue connecting to which I answered "yes". Then it asked for my password (the password I use on my Mac) and thereafter, everything went smoothly.
2. To connect to Ubuntu on the EeePC 901, I only had to ensure that openSSH was installed and running. Then issuing the same command as above (with change in IP, of course) and no problems were met.
3. To connect to Windows 7 was not quite as straightforward.
First, I had to install freeSSHd, which is actually free and install it.
Next, it was necessary to open port 22 (the SSH port) in the Windows firewall as described here. I actually, added new "rules" for port 22 for incoming and outgoing options.
When freeSSHd is started, a favicon appears in the tray which needs to be clicked to allow configuring the settings.
Once freeSSHd is running and port 22 open in the firewall (or ready to open once a request is made), connecting from Haiku is easy using the same command as before.

Now another very useful command is scp which allows secure file copying either TO the remote computer or FROM it to the Haiku machine.
To copy TO the remote computer, I used this command:
scp "path_to_file_in _haiku" "username@192.168.1.x:path_to_where_incoming_file_should_download"

To copy FROM the remote box, I used this
scp "username@192.168.1.x:path_to_file: "path_to_where_incoming_file_is_downloaded"

Both worked perfectly when connecting the the Mac and Ubuntu. However, I couldn't get it to work at all to ot from Window7 so this needs some more work.
Incidentally, while I was dealing with the firewall problem in Windows I came across a nice free file for checking which ports are open in Windows called currports.
Additionally, there's a really great screencast on the use of ssh and scp in Haiku that is definitely worth watching.

No comments:

Post a Comment