maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Ftp server (https://talk.maemo.org/showthread.php?t=35578)

les_garten 2009-12-09 15:36

Re: Ftp server
 
Quote:

Originally Posted by bandora (Post 419012)
I did a dpkg -i proftpd_1.3.2c-1_armel.deb it goes to "Setting up proftpd (1.3.2c-1)"

Then goes back to /home/user/MyDocs and doesn't show up anywhere.. any suggestions?

Thanks in advance

EDIT: it does show up in the application manager but that's it.. it doesn't show up in the menu..

You bring up a good point. Perhaps all packages should drop a HowTo into the MyDocs dir that tells where everything is and how to use it. This should be a requirement for packagers IMHO.

Bratag 2009-12-09 16:41

Re: Ftp server
 
Quote:

Originally Posted by les_garten (Post 418968)
I do see an advantage to having a FTP server that is started "on occasion" on N900. Every Windows OS has an FTP client built in. If you do support, you might have some files kept on your device. Then you could start the server if you need the files and make them available over the network. Then stop the server when you're done. It would require no SW to be put on the client machine and could be quickly deployed.

Exactly - not every box I want to transfer from runs an ftp server. I much prefer ftping into the N900 than out.

On another note this auto build process is dumber than hell.

I will try another shot at it and then I will just put the deb up at my garage page.

Bratag 2009-12-09 19:32

Re: Ftp server
 
Well it took me hard coding in some of the optifying parameters but the build now works and installs everything in the correct location and looks for everything in the correct locations.

Version e is the on you need.

taril 2009-12-09 20:53

Re: Ftp server
 
I tried to access ftp server via firefox, but it ask username and password.
What are they?

Bratag 2009-12-09 21:56

Re: Ftp server
 
Quote:

Originally Posted by taril (Post 419598)
I tried to access ftp server via firefox, but it ask username and password.
What are they?

You have to configure the /opt/etc/proftpd.conf file first. There are many guides online for how to do that. Personally I use a perl script to generate ftpd.passwd and ftpd.group files and then configure the conf file with


Code:

#Alternative user auth
AuthUserFile /opt/etc/ftpd.passwd
AuthGroupFile /opt/etc/ftpd.group

I can post the perl script here - you will need to grab down some extra perl libs but they are easily found.

taril 2009-12-09 23:09

Re: Ftp server
 
Ok, thank you very much!

taril 2009-12-10 17:27

Re: Ftp server
 
I cant login with anonymous... Do I miss something? (brain maybe)

Bratag 2009-12-10 19:50

Re: Ftp server
 
Quote:

Originally Posted by taril (Post 421235)
I cant login with anonymous... Do I miss something? (brain maybe)

Its a bad idea to allow anonymous logins - much better to set up an ftp user .

taril 2009-12-10 20:37

Re: Ftp server
 
Ive got it! Thanks!
IS it possible to share the root filesystem?

11/(14-17)/09 2009-12-10 20:44

Re: Ftp server
 
I dunno if this was mentioned, but if someone wants to use t-mobile in the USA with something like this, they can try to get t-mobile total internet with VPN, which they do not NAT.

ex:
http://wiki.howardforums.com/index.p...ernet_with_VPN

or there may be a way to do a socks proxy, and socksify the app... or do an SSH tunnel. As long as they give you a hole somewhere to shove those packets through, you can make it work!

taril 2009-12-10 21:03

Re: Ftp server
 
Quote:

Originally Posted by Bratag (Post 421461)
Its a bad idea to allow anonymous logins - much better to set up an ftp user .

Ok, help me please to create a user for proftpd! Thanks!

Step by step, uhhh baby.... :D:D:D

11/(14-17)/09 2009-12-10 21:09

Re: Ftp server
 
he alread told you how to set up logins, even offered to post a perl script that he uses to generate login files.

You have to configure the /opt/etc/proftpd.conf file first. There are many guides online for how to do that.

this would be a good chance for you to flex that big thing between your ears and get your feet wet a little, look for an online guide to configure proftpd.conf, it will probably just be a matter of editing it like a text file.

taril 2009-12-10 22:11

Re: Ftp server
 
Ive got it! It was painful.

Here you are ppl:

http://ubuntuforums.org/showthread.php?t=79588

Laughing Man 2009-12-21 05:14

Re: Ftp server
 
Eesh, I've been hammering at this for a while and still can't get it to start.

The exec /home/opt/sbin/proftpd -c /opt/etc/proftpd.conf command just results in the termial closing

the /etc/event.d etc.. command doesn't even work.

/opt/sbin/proftpd.conf just reports a fatal ServerIdent: expected Boolean parameter on line 8.

I'm guessing the exec command does work. But then trying to login to the FTP via my Ubuntu Desktop just results in error connecting: connection refused.

This whole /opt situation is pretty annoying. It means what material you find in other Linux OS won't work on the N900 since everything has to be moved around.

But any help would be appreciated.

Edit: Removed ServerIdent.. now it says it's unable to determine the IP address. No valid servers configured. Error processing the /opt/etc/proftpd.conf

Edit2: now we are getting somewhere

Code:

$ /opt/sbin/proftpd
vendetta-n900 - PRIVS_ROOT: unable to seteuid(): Operation not permitted
vendetta-n900 - PRIVS_ROOT: unable to setegid(): Operation not permitted
vendetta-n900 - PRIVS_RELINQUISH: unable to seteuid(PR_ROOT_UID): Operation not permitted
vendetta-n900 - PRIVS_RELINQUISH: unable to setegid(session.gid): Operation not permitted
vendetta-n900 - PRIVS_RELINQUISH: unable to seteuid(session.uid): Operation not permitted
vendetta-n900 - mod_delay/0.6: error opening DelayTable '/opt/var/proftpd/proftpd.delay': No such file or directory
vendetta-n900 - unable to set daemon groups: Operation not permitted
vendetta-n900 - unable to set uid to 65534, current uid: 29999


DaSilva 2010-01-02 04:00

Re: Ftp server
 
I have created a startup script in /etc/init.d/proftpd

Code:

  #!/bin/sh

  # ProFTPD files
  FTPD_BIN=/opt/sbin/proftpd
  FTPD_CONF=/opt/etc/proftpd.conf
  PIDFILE=/home/opt/var/proftpd/proftpd.pid

  # If PIDFILE exists, does it point to a proftpd process?

  if [ -f $PIDFILE ]; then
  pid=`cat $PIDFILE`
  fi

  if [ ! -x $FTPD_BIN ]; then
    echo "$0: $FTPD_BIN: cannot execute"
    exit 1
  fi

  case $1 in

    start)
      if [ -n "$pid" ]; then
        echo "$0: proftpd [PID $pid] already running"
        exit
      fi

      if [ -r $FTPD_CONF ]; then
        echo "Starting proftpd..."

        $FTPD_BIN -c $FTPD_CONF
        ps -ef | pgrep -x proftpd | awk 'NR>1{exit};1' > $PIDFILE

      else
        echo "$0: cannot start proftpd -- $FTPD_CONF missing"
      fi
      ;;

    stop)
      if [ -n "$pid" ]; then
        echo "Stopping proftpd..."
        rm $PIDFILE
        kill -TERM $pid

      else
        echo "$0: proftpd not running"
        exit 1
      fi
      ;;

    restart)
      if [ -n "$pid" ]; then
        echo "Rehashing proftpd configuration"
        kill -HUP $pid

      else
        echo "$0: proftpd not running"
        exit 1
      fi
      ;;

    *)
      echo "usage: $0 {start|stop|restart}"
      exit 1
      ;;

  esac

  exit 0

and with this you can start proftpd with "/etc/init.d/proftpd start" and stop it with "/etc/init.d/proftpd stop" from the console.
To make it easier to start proftpd from the menu/desktop I created this script:

Code:

#!/bin/sh
# proftpd-toggle
if pgrep -x proftpd > /dev/null; then
sudo /etc/init.d/proftpd stop > /dev/null
else
echo Started
sudo /etc/init.d/proftpd start
fi
exit 0

The developer could integrate those two scripts and instead of the current menu entry of proftpd it could link to the toggle script.
Thanks.

chrisp7 2010-01-20 12:18

Re: Ftp server
 
How could you share the main flash drive using proftpd on the N900? (The 30Gb one) is it possible?

digitalvoid 2010-01-23 21:26

Re: Ftp server
 
I have also a working proftpd install on my device, but it's very slow in data traffic (between 80 ... 600KB/s to my 16GB). I was expecting a much faster connection...

What's your up & download speed?

DaSilva 2010-01-24 00:18

Re: Ftp server
 
Not more than 650 KB/s :(
I thought it would be faster than SCP but it is the same.

cafeine 2010-03-27 20:48

Re: Ftp server
 
can someone please provide a direct link to instructions for the noobs here?
I installed proftpd, tried to make the autostart files as described above but no luck...

a simple guide would be highly appreciated...thx...

cafeine 2010-04-05 14:41

Re: Ftp server
 
It's pretty lame to have a working application and not a one page manual how to use it.

The comments in previous pages are not helpful for the noobs,i think a step by step guide is essential.

Can't anybody dedicate 1 hour to make it?...is it so difficult?

Bratag 2010-04-05 14:51

Re: Ftp server
 
Not sure what people want as far as instructions on the app. You install the package and then follow any of a dozen configuration guides for proftpd

the config file is in /opt/etc

http://www.proftpd.org/docs/howto/ConfigFile.html

Is a basic example.

cafeine 2010-04-08 18:21

Re: Ftp server
 
maybe because we don't have the time to search dozens of guides to do such a simple think or maybe because there is no reason to have to search for instructions all over the web and mix and match steps, retry refail etc instead of the creator posting a simple but complete 1,2,3 guide of all the specific steps nessessary for anyone to have a running program in his device.

CepiPerez 2010-05-11 12:41

Re: Ftp server
 
Thanks!
This is what I was looking for...
I don't know how I didn't see it before...

ndi 2010-06-28 18:42

Re: Ftp server
 
Excellent effort, but I'm out of here. I have OpenSSH cramps every time I see a conf file that has no preconfiguration. The home site offers a conf example for anonymous and one for virtual sites (nothing in between). This might be second nature for Linux users, but it took me 4 days to start ssh on Windows - I ended up tarballing me the entire installation. True, some woes came with cywin conflicts.

Might I suggest the very nice implementation VNC server has. One icon in menu, once clicked you are good for one login, no password needed. Click the icon, open a connection via VNC.

Alternately, a password could be typed at startup. Password is inserted into the conf and daemon started. Upon exiting the app, daemon stops. So click the icon, type a random text, login. Elegant, simple, universal. Does not preclude the intended usage.

I'm fairly sure this could be implemented with a small shell script, allowing for a "ftpserver <password>" command. Unfortunately, I can't do Linux shell worth a damn.

igorlt 2010-07-31 17:31

Re: Ftp server
 
I was copying some files from my N900 to my PC, and Norton alerted me that proftpd has a behaviour that looks like a trojan.

Does anyone know why?

aligatro 2010-07-31 17:39

Re: Ftp server
 
Why not use already existing openssh-server package on n900 ?
You can then use winscp to connect to n900.

igorlt 2010-07-31 17:41

Re: Ftp server
 
Quote:

Originally Posted by aligatro (Post 771552)
Why not use already existing openssh-server package on n900 ?
You can then use winscp to connect to n900.

Actually I prefer to use OpenSSH, but now I´m using an application that does not support SFTP.

ndi 2010-07-31 23:28

Re: Ftp server
 
Quote:

Originally Posted by igorlt (Post 771547)
I was copying some files from my N900 to my PC, and Norton alerted me that proftpd has a behaviour that looks like a trojan.

Does anyone know why?

Because it does. Accessing files and sending them over the wire is exactly what trojans are about.

I'm connecting the other way now. Server on PC, client on N900. At least that's a GUI app. Still rough around the edges, though, to chdir I have to select a folder than go to menu and choose File > change directory ... (even though ellipsis seem to suggest a dialog is about to happen).

Oh well. Hey, concurrent transfers.

avijitkt 2010-08-22 20:27

Re: Ftp server
 
Quote:

Originally Posted by taril (Post 421722)
Ive got it! It was painful.

Here you are ppl:

http://ubuntuforums.org/showthread.php?t=79588

Thanks :D
Your link has made the configuration just easy

lazart 2011-03-26 16:10

Re: Ftp server
 
hello nononoyes,
i've tried your proftp configuration without all those scripts. i just want to start it in terminal if necessary, but i just get "530 login incorrect error". isn't your configuration possible without all that scripts?


edit: I also tried anonymous log in, while uncommenting that lines in config, nothing working.

here's my n900 proftp.conf:

Code:

# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use.  It establishes a single server
# and a single anonymous login.  It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName                      "N900"
ServerType                      standalone
DefaultServer                  on

# Port 21 is the standard FTP port.
Port                            21

# Don't use IPv6 support by default.
UseIPv6                        off

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask                          022

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances                    30

# Set the user and group under which the server will run.
User                            nobody
Group                          nogroup

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
DefaultRoot /home/user/

# Normally, we want files to be overwriteable.
AllowOverwrite          on

# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
  DenyAll
</Limit>

RootLogin on

## A basic anonymous configuration, no upload directories.  If you do not
## want anonymous users, simply delete this entire <Anonymous> section.
#<Anonymous ~ftp>
#  User                        ftp
#  Group                                ftp
#
#  # We want clients to be able to login with "anonymous" as well as "ftp"
#  UserAlias                    anonymous ftp
#
#  # Limit the maximum number of anonymous logins
#  MaxClients                  10
#
#  # We want 'welcome.msg' displayed at login, and '.message' displayed
#  # in each newly chdired directory.
#  DisplayLogin                welcome.msg
#  DisplayChdir                .message
#
#  # Limit WRITE everywhere in the anonymous chroot
#  <Limit WRITE>
#    DenyAll
#  </Limit>
#</Anonymous>


zlatokosi 2011-05-06 16:02

Re: Ftp server
 
PLEEEEEEEAAAAAASSSSE HELP!!!

I've tried everything. I looked at the ubuntu forums too. I've spent two days on this, guys... and I just can't get it to work. It either closes terminal or gives an "error on line... ".

I just want a freaking working ftp server, by this point I don't care if it's only anonymous login, if 3000 connections can be made.... really, I just want to be able to ftp into my N900.

Can someone PLEASE give me instructions on how to do this. Seriously, if I can get OS8 working on the tablet, I should be able to get this working. But I can't.

Any suggestions?

Mentalist Traceur 2011-05-18 23:20

Re: Ftp server
 
busybox-power includes an "ftpd" command in busybox (for the newbs - busybox is a program that provides most of the shell commands on embedded systems like the N900).

I haven't used it, but you all might find it easier.

luketanti 2011-08-25 19:28

Re: Ftp server
 
I can't get this to start. I edited the conf file but I can not start proftpd? Can some one tell me the exact commands to make it start??

teamer 2012-01-15 10:42

Re: Ftp server
 
STEP BY STEP MAKING PROFTPD WORK ON N900 :)

You will be able to login with the default user ONLY
to change the password for the default user type :
Code:

sudo gainroot
passwd user

and enter your new password

Step 1 : Enable extras-devel repository and install proftpd

after installing :

Step 2 : in xterm type
Code:

sudo apt-get install nano-opt
Step 3 :
Code:

sudo gainroot
nano /opt/etc/proftpd.conf

Step 4 : use this config :

Code:

ServerName                      "Your FTP server name"
ServerType                      standalone
DefaultServer                  on

# Port 21 is the standard FTP port.
Port                            21

# Don't use IPv6 support by default.
UseIPv6                        off

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask                          022

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd).
MaxInstances                    8

# Set the user and group under which the server will run.
User                            nobody
Group                          nogroup

# To cause every FTP user to be "jailed" (chrooted) into their home
# directory, uncomment this line.
DefaultRoot ~

# Normally, we want files to be overwriteable.
AllowOverwrite          on

# to list hidden files too
ListOptions                    "-a"
# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
  DenyAll
</Limit>

<Limit LOGIN>
        AllowGroup ftp
        DenyAll
</Limit>

Step 5 : create a group to carry ftp users (if you want to make more than one user later with specific directories and stuff)

Code:

groupadd ftp
Step 6 : Add 'user' to the ftp group

Code:

usermod -a -G ftp user
Step 7 : the start/stop script :
Code:

nano /etc/init.d/proftpd
then user this code (thanks for who wrote it ;) but it's buggy a lil bit)
Code:

#!/bin/sh

  # ProFTPD files
  FTPD_BIN=/opt/sbin/proftpd
  FTPD_CONF=/opt/etc/proftpd.conf
  PIDFILE=/home/opt/var/proftpd/proftpd.pid

  # If PIDFILE exists, does it point to a proftpd process?

  if [ -f $PIDFILE ]; then
  pid=`cat $PIDFILE`
  fi

  if [ ! -x $FTPD_BIN ]; then
    echo "$0: $FTPD_BIN: cannot execute"
    exit 1
  fi

  case $1 in

    start)
      if [ -n "$pid" ]; then
        echo "$0: proftpd [PID $pid] already running"
        exit
      fi

      if [ -r $FTPD_CONF ]; then
        echo "Starting proftpd..."

        $FTPD_BIN -c $FTPD_CONF
        ps -ef | pgrep -x proftpd | awk 'NR>1{exit};1' > $PIDFILE

      else
        echo "$0: cannot start proftpd -- $FTPD_CONF missing"
      fi
 ;;

    stop)
      if [ -n "$pid" ]; then
        echo "Stopping proftpd..."
        rm $PIDFILE
        kill -TERM $pid

      else
        echo "$0: proftpd not running"
        exit 1
      fi
      ;;

    restart)
      if [ -n "$pid" ]; then
        echo "Rehashing proftpd configuration"
        kill -HUP $pid

      else
        echo "$0: proftpd not running"
        exit 1
      fi
      ;;

    *)
      echo "usage: $0 {start|stop|restart}"
      exit 1
      ;;

  esac

  exit 0

*hint , to save the texts use ctrl+o , to exit nano use ctrl+x

if you want to use xterm to start and stop the ftp server :
Start :
Code:

sudo /etc/init.d/proftpd start
Stop :
Code:

sudo /etc/init.d/proftpd stop
ReStart :
Code:

sudo /etc/init.d/proftpd restart
Thats all , Enjoy !

If you plan to use something like queen beccon to stat the FTP server , its preferred you do this : (as a root , sudo gainroot)

Code:

chmod 777 /etc/init.d/proftpd
nano /etc/init.d/proftpd_start

and paste this :
Code:

#!/bin/sh
# proftpd-toggle
if pgrep -x proftpd > /dev/null; then
sudo rm /home/opt/var/proftpd/proftpd.pid
sudo killall proftpd
echo Stopped
else
echo Started
sudo /etc/init.d/proftpd start
fi
exit 0

then finally
Code:

chmod 777 /etc/init.d/proftpd_start
no in queen beecon , create a custom command and let it be
Code:

/etc/init.d/proftpd_start
this will toggle the proftpd on/off


All times are GMT. The time now is 13:07.

vBulletin® Version 3.8.8