www.zeroshell.org Forum Index www.zeroshell.org
Linux Distribution for server and embedded devices
 
 SearchSearch  RegisterRegister  UsergroupsUsergroups 
 ProfileProfile  Log inLog in  Log in to check your private messagesPrivate Message 

Best way to tranfer files to ZeroShell?

 
Post new topic   Reply to topic    www.zeroshell.org Forum Index -> ZeroShell
View previous topic :: View next topic  
Author Message
redtdi



Joined: 21 Nov 2008
Posts: 22

PostPosted: Thu Feb 05, 2009 3:03 pm    Post subject: Best way to tranfer files to ZeroShell? Reply with quote

I am trying to use scp to transfer files to one of my ZeroShell boxes (the multilink ppp package) and was wondering what the best way to transfer files to ZeroShell is. When I use SCP from my Mac I get a "TERM environment variable not set" message even though it is.

I have used the ftp client to transfer files at times but i really just want to be able to transfer files from my Mac directly to a ZeroShell box.

Thanks,
Ken
Back to top
View user's profile Send private message
fulvio
Site Admin


Joined: 01 Nov 2006
Posts: 1037

PostPosted: Thu Feb 05, 2009 6:03 pm    Post subject: Reply with quote

It is not possible to transfer files on Zeroshell using scp because the login shell of the user admin is not a standard shell, but a menu manager.

One solution could be to use the nc (netcat) command. By way of example, make un netcat to listen to on tcp port 3000 of the Zeroshell with the command

nc -l -p 3000 |tar xvf -

and from your Mac/Linux transfer the files with the command

nc IP_address 3000 < file.tar

Regards
Fulvio
Back to top
View user's profile Send private message Send e-mail
tshiktshuk



Joined: 17 Feb 2009
Posts: 1

PostPosted: Tue Feb 17, 2009 10:38 am    Post subject: Reply with quote

Hi I am new to Zeroshell and this is my first post on the forum.

1. Thank you for zeroshell with the UMTS/HSDPA feature.

It is the only linux distro I have found so far that connects my
Telit MX20 usb modem (amoi vendor 1614 product 0800) to
the web out of the box!!!

Sadly my Ubuntu (8.10) installation cannot go anywhere else than to www.google.com with it for now.
Thus I believe there is a bug somewhere in the zeroshell DNS setup.
eg I havent touched any setting so it should work (eg- my eee-pc surfs all over the world, and also my Winborg Xp surfs anywhere i like it to.

2. Why not incorporate the midnight commander shell with its beautyfull editor and the mc-serv?
or
3. What's the problem with incorporating the kernel NFS daemon ?

4. why use a DB database instead of just having the config files in text as they are and the basic executables packed in tarballs for a modular on the fly installation, kind of like SPB linux used to be? or like freesco had.
Seems to me like having to passover the stream to get water...

In this way anybody could write an add-on and put it out on the web or send it to you.

5. I appreciate the web interface a lot,
It is beautiful. But why not have DHCP for subnet 192.168.0.0 on by default ?
Also I would have appreciated a more clearly visible stepping order in the setup.


I hope you appreciate my feedback.

Thank you a million times for your time and efforts in creating zeroshell I and my friends will have much enjoyment with it.[/quote]
_________________
simplicity always work
Back to top
View user's profile Send private message Send e-mail
kawarmc



Joined: 25 Feb 2009
Posts: 10

PostPosted: Sun Feb 07, 2010 7:02 pm    Post subject: Reply with quote

If you want to enable sftp transfers to Zeroshell, you can edit /etc/passwd and change the line for admin user to read like:

Code:
admin:x:0:0:root:/root:/bin/bash


This is just temporal, if you reboot the box, you'll loose the changes made to /etc/passwd but it works if you only want to tranfer files from time to time.
Back to top
View user's profile Send private message
Marcelo



Joined: 23 Jan 2010
Posts: 39

PostPosted: Sun Feb 07, 2010 8:51 pm    Post subject: Reply with quote

You could also ssh to ZS and sftp from there, instead, as it has the client installed.
Back to top
View user's profile Send private message
atheling



Joined: 24 Sep 2009
Posts: 212

PostPosted: Sun Feb 07, 2010 9:51 pm    Post subject: Re: Best way to tranfer files to ZeroShell? Reply with quote

redtdi wrote:
I am trying to use scp to transfer files to one of my ZeroShell boxes (the multilink ppp package) and was wondering what the best way to transfer files to ZeroShell is. When I use SCP from my Mac I get a "TERM environment variable not set" message even though it is.

I have used the ftp client to transfer files at times but i really just want to be able to transfer files from my Mac directly to a ZeroShell box.

Thanks,
Ken


Here is what I have done to copy files to and from Zeroshell from my MacBook:

1. Login in to Zeroshell and get to the bash prompt.
2. Use the chsh command to change the admin shell program to /bin/bash

Now you can use the standard scp program from the Mac Terminal to copy things to Zeroshell (or from Linux or Windows running Cygwin for that matter).

However I go another step farther since I'm dealing with Linux boxes all day long at work:

3. Download and install MacFuse from http://code.google.com/p/macfuse/
4. Download and install MacFusion from http://www.macfusionapp.org/

Between these two programs you have a nice UI to mount anything you can get to via SSH as a read/write file system in the Finder. Now you can mount the Zeroshell box and drag and drop files.
Back to top
View user's profile Send private message
Lightyear



Joined: 24 Dec 2009
Posts: 9
Location: Montevideo, Uruguay

PostPosted: Mon Feb 08, 2010 3:06 am    Post subject: Reply with quote

What works for me is ssh-ing to ZeroShell and then go to the ZeroShell system prompt. From there you can scp to/from anywhere in your network that has password authentication.
And, if you want key authentication, just scp the keys to ZeroShell.
This is what I use to backup ZeroShell to a local server. And what I used to bring Joe to ZeroShell.
Admittedly, mine is a Linux-only network, but from what I have heard from the Mac, it should be a piece o'cake.

Hth.
Back to top
View user's profile Send private message
jt



Joined: 26 Oct 2008
Posts: 15

PostPosted: Tue Mar 16, 2010 6:55 pm    Post subject: Reply with quote

I sometimes use a USB flash drive to copy files to or from zeroshell. (My sshd on my server only allows key pairs, so I can't just scp without installing a key first)

Insert the flash drive in a usb slot.
ssh to zeroshell, or use the console, and select a shell prompt.
Enter:
dmesg

My zeroshell shows this (I have zeroshell booting from a hard drive):
...etc...
scsi 2:0:0:0: Direct-Access USB 2.0 USB Flash Drive 0.00 PQ: 0 ANSI: 2
sd 2:0:0:0: [sda] 7897088 512-byte hardware sectors (4043 MB)
...etc...
sd 2:0:0:0: [sda] Assuming drive cache: write through
sda: sda1

So, my zeroshell assigns the flash drive to be sda1. You may get a different sdxx name, depending on your hardware.

Enter:
mkdir /usbtemp {make a temporary mount point}
mount /dev/sda1 /usbtemp {mount the flash drive}
cd /usbtemp
ls {see the files and directories that are on the flash drive}

copy files as needed, using cp

when done:
cd /
umount /usbtemp


Now you can remove the flash drive from the usb slot.
Back to top
View user's profile Send private message
Karachi123



Joined: 25 Mar 2010
Posts: 1

PostPosted: Thu Mar 25, 2010 12:41 am    Post subject: Reply with quote

At least this solved my file sharing problem. thanks
Back to top
View user's profile Send private message Yahoo Messenger
_dan



Joined: 15 May 2011
Posts: 9

PostPosted: Sun May 15, 2011 2:29 am    Post subject: Reply with quote

kawarmc wrote:
If you want to enable sftp transfers to Zeroshell, you can edit /etc/passwd and change the line for admin user to read like:

Code:
admin:x:0:0:root:/root:/bin/bash

I made this script to to shift between menu and bash, enable/disable SCP access.
Code:
#!/bin/bash
# Script to enable/disable SCP on ZeroShell

ENABLE=/bin/bash
DISABLE=/root/kerbynet.cgi/scripts/localman

case $(awk -F: '/admin/{print $NF}' /etc/passwd) in
        $DISABLE ) chsh -s ${ENABLE}  admin ;;
        $ENABLE  ) chsh -s ${DISABLE} admin ;;
esac



This is my first post on this forum, thanks fulvio and ZeroShell community for this useful OS.

Regards,
Dan
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    www.zeroshell.org Forum Index -> ZeroShell All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group