Tag Info

Hot answers tagged

9

Not with the ftp programs I've run into, as they expect a script on their standard input but a shebang would pass the script name on their command line. You can use a here document to pass a script to ftp through a shell wrapper. #!/bin/sh ftp <<EOF open 192.168.1.1 put *.gz EOF Lftp accepts a script name passed as an argument. #!/usr/bin/lftp -f ...


8

FTP has quite a few commands. While the client maps some of these to a more userfriendly text interface. For example, if you use ftp -v (depending on your ftp client, the one I use needs ftp -vd), you'll notice something like the following (---> shows what is sent to the server): $ ftp -vd ftp.debian.org Connected to ftp.debian.org. 220 ftp.debian.org ...


6

Use read (see help read) - can be like this: read -p "please enter ftp server : " SERVER read -p "username : " USERNAM IFS= read -s -p "password :" USERPSS In this way, you'll have the server, username and password collected in variables, respectively, $SERVER, $USERNAM and $USERPSS. (Note that because of -s, the password will not be echoed and thanks to ...


6

What you have is not a unix command line, what you have is an FTP session. FTP is designed primarily to upload and download files, it's not designed for general file management, and it doesn't let you run arbitrary commands on the server. In particular, as far as I know, there is no way to trigger a file copy on the server: all you can do is download the ...


6

Whew. I solved the problem. It amounts to a config but within /etc/pam.d/vsftpd Because ssh sessions succeeded while ftp sessions failed, I went to /etc/pam.d/vsftpd, removed everything that was there and instead placed the contents of ./sshd to match the rules precisely. All worked! By method of elimination, I found that the offending line was: ...


6

You could use the SCP program that comes with famed terminal emulator PuTTY: pscp.exe If you create public/private key files, pscp.exe should have the ability to just do something like: pscp *.csv *.txt username@unixhost:whatever/subdirectory/ from inside a .bat file.


6

SFTP is not FTP. It's the sftp subsystem of ssh, it's handled by the sshd daemon, not vsftpd or any FTP server. It's on the ssh TCP port (22), not the FTP port 21 (well FTP commands are on 21 while data connections are on arbitrary ports, and those multiple connections in FTP are one of the many reasons why SFTP is so much better than FTP). ss -lp sport = ...


6

Symlinks themselves have 777 because in Unix, file security is judged on a file/inode basis. If it's the same data they're operating on, it should have the same security conditions, regardless of the name you gave the system to open it. [root@hypervisor test]# ls -l total 0 lrwxrwxrwx. 1 root root 10 Jun 8 16:01 symTest -> /etc/fstab [root@hypervisor ...


5

Since you're using Gnome on Ubuntu, why not use the default file manager (Nautilus)? Under Ubuntu 10.04, choose “Connect to Server” in the Places menu, select “Public FTP” or “FTP (with login)” as the service type, enter the server name and other parameters (you can define bookmarks in this dialog box too), and voilà.


5

Ideally those would be SFTP accounts, using SSH public key authentication rather than passwords. You'd gain both security and convenience. But let's assume you don't have a choice of not using FTP with passwords. You could store the passwords (the .netrc file) on an encrypted filesystem and mount that filesystem only when you want to access it. A simple way ...


5

lftp would do this with the command mirror -R -P 20 localpath - mirror syncs between locations, and -R uses the remote server as the destination , with P doing 20 parallel transfers at once. As explained in man lftp: mirror [OPTS] [source [target]] Mirror specified source directory to local target directory. If target directory ends with a ...


4

I don't know if it is good practice to answer my own question but I found a simple solution that enables ftp login. I needed to add the line /usr/sbin/nologin to the file /etc/shells. Right after this modification the ftp server started to accept login from users to whom the shell is set /usr/sbin/nologin. So they cannot login through ssh but it works ...


4

Why it doesn't work When you attempt to change the modification time of a file with touch, or more generally with the underlying system call utime, there are two cases. You are attempting to set the file's modification time to a specific time. This requires that you are the owner of the file. (Technically speaking, the process's effective user ID must be ...


4

Use just about any FTP client other than the basic ftp program. Store your password in ~/.netrc and use wget: wget -r ftp://username@example.com/path/to/directory Keep in mind that the -r option has a default maximum depth of 5. You can use -l to increase it. Use lftp: open username@example.com mirror /path/to/directory Use ncftp: open -u username ...


4

You can use shell globbing on the remote system by making sure glob is on, then doing mget. See http://www.proftpd.org/docs/howto/Globbing.html for more information. I believe that's as far as you can get with FTP. If you can get ssh acess instead, there is much more that you can do, including grepping and modifying the files on the server.


4

Two suggestions: Does whatever user ID that will run FTP have "write" permissions on the "root" directory that vsftpd will use as its current working directory? vsftpd doesn't want a writable working directory. The vsftpd.conf file can have a hide_file directive. Depending on the regular expression specified by that directive, anonymous users might not ...


4

There are two likely reasons that this could happen -- you do not have write and execute permissions on the directories leading to the directory you are trying to upload to, or vsftpd is configured not to allow you to upload. In the former case, use chmod and chown as appropriate to make sure that your user has these permissions on every intermediate ...


4

Usually, Korn and Bash shells have a "restricted shell" mode. Getting to a restricted shell might be as easy as typing rsh (avoid "remote shell" - definitely not a good idea in 2012) or rbash. But I'm not sure what you want. The FTP protocol might allow a client to send arbitrary commands (with QUOTE), but the FTP server (ftpd) probably shouldn't just ...


4

You probably have to use something more sophisticated. FTP itself (if I remember correctly) is not able to transfer entire directories, all it knows about is transferring a file. Thus the client has to translate your request "send this directory" into a sequence of upload this file (possibly preceded by make this directory). One such sophisticated client ...


4

From ftp client, to check if remote ftp server support passive mode, after login, type quote PASV. Following are connection examples to a vsftpd server with passive mode on and off vsftpd with pasv_enable=NO # ftp localhost Connected to localhost.localdomain. 220 (vsFTPd 2.3.5) Name (localhost:john): anonymous 331 Please specify the password. Password: ...


4

Your ftp server needs a channel to transfer data. Port 21 is used to establish the connection. So to make data transfer possible you'd need to enable port 20 as well. See the following configuraton First load the following module to make sure passive ftp connections are not rejceted modprobe ip_conntrack_ftp Allow FTP connections on port 21 incoming and ...


4

To achieve this need following things : Method 1# By changing User's Home directory Make sure following line exists chroot_local_user=YES Set User HOME Directory to /var/www/ , if you want to change for existing user then you can use : usermod --home /var/www/ username then set required permission on /var/www/ Method 2# If you don't want to ...


4

If the file abc.txt contains the list of filenames relative from /path/to/base: ssh user@server tar c -T /path/to/abc.txt -C /path/to/base | (cd /tmp; tar xv) This creates a tarball on-the-fly, without actually saving it anywhere, pipe it to the local shell, extract, effectively copying the listed files. EXTRA TIPS If the file abc.txt contains the list ...


4

Here is one way - using GNU ftpsync. Note that the download links on http://www.gnu.org/software/ftpsync/ seem to be broken as of now; the page you'd need is http://savannah.gnu.org/projects/ftpsync ... It seems that I got this via git, probably through the address: git clone git://git.sv.gnu.org/ftpsync.git Note that ftpsync is a Perl script, in the ...


4

If there are 70000 files but your FTP software only shows 9998, then obviously it's the fault of your FTP software, and there is no limit on the filesystem. You'll need to use another FTP software. This assumes that your PHP script is correct, of course. Note that some FTP programs may omit dot files (files whose name begins with .) by default. ...


3

Based on your comment, I would use netcat and not bother with FTP at all (assuming you can't use scp). Source server, cat myfile | nc -q 10 -l -p <someport> Target server, nc sourceserver someport > targetfile If you still think you need an FTP server (and your question still doesn't say why it must support FTP), then you can look through the ...


3

You could run rsync over ssh. Set up ssh keys so you can do it non-interactively (i.e. avoid having to use a password). Use cron to schedule it. Check out this article. http://www.askapache.com/security/mirror-using-rsync-ssh.html


3

Not sure why you chose vsftpd, as the documentation is notoriously lacking/distributed. However, to answer your question - the simplest method of allowing registered user access is through enabling local users: # Uncomment this to allow local users to log in. local_enable=YES There are other options, dependent on your needs, such as storing users in a ...


3

I believe you'll need to run your dropbear ssh server inside a chroot'd jail if you want to restrict it to certain directories. If you were using a recent OpenSSH, I'd suggest using the ChrootDirectory setting in your sshd_config. It doesn't appear as though dropbear has a similar parameter, so you'll have to do it manually.



Only top voted, non community-wiki answers of a minimum length are eligible