Tag Info

Hot answers tagged

14

When you define an alias, the command you set is run instead of the one you wrote. This means that when you run ftp abc.com, what is actually executed is echo do not use ftp. Use sftp instead abc.com A simple solution is to use a function instead of an alias: ftp(){ echo 'do not use ftp. Use sftp instead'; } Alternatively, you could use printf as ...


12

alias ftp='echo do not use ftp. Use sftp instead. # '


7

Just put a space and the comment character # at the end of the alias string: alias ftp='echo do not use ftp. Use sftp instead. #' ftp abcd.com do not use ftp. Use sftp instead. This will cause the parameters to be treated as a comment. Just do not forget to add a space before # otherwise it will not be interpreted as a separate token after the alias ...


6

You might be looking for rcp, it performs remote execution via rsh so you will have to rely on that and have in mind that all communication is unsecure.


5

Non-chroot access If you don't have a FTP server setup, and you trust the user that will be logging in, not to go poking around your server too much, I'd be inclined to give them an account to SFTP into the system instead. The CentOS wiki maintains a simple howto titled: Simple SFTP setup that makes this pretty pain free. I say it's pain free because you ...


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

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

Use a .netrc file in your home directory. The content is: # machine <hostname> login <username> password <password> machine ftp.example.com login myuser password $ecret If this is something you're doing programmatically, write the .netrc before connecting, delete it when you're done.


4

lftp can do that. You've got: pget to download a single file with several connections mirror -P 4 to download a tree with up to four connections and you can put any get in background to start another one with get file &  (also Ctrl-Z to put a download in background when using it interactively). You can set the number of connections per site ...


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. ...


4

There is a program to interact with interactive command line tools exactly like the ftp example: expect. It is a specialized script shell, extending the on the scripting language tcl. It is very powerful, but you may get away without learning everything about it. A very useful tool is autoexpect, which can record an interactive session as an expect script. ...


3

Consider using inotifywait eg watch a directory inotifywait . Then create a file in that direectory. Here's a previous answer from Unix/Linux stackexchange


3

I think NFS is quite underrated for this sort of task, where you want convenience, speed and don't care about security. NFS is really simple to set up, especially on the client: see this guide for ubuntu. From the client's perspective you just mount the server directory and it looks just like a local drive and you can use cp or rsync or whatever commands you ...


3

You cannot disable encryption completely on ssh/scp but you can force it to use a weaker cipher that is much less cpu intensive. Make sure that compression is not turned on in your ssh_config or on the command line and add -c arcfour,blowfish-cbc to your scp command line to select weaker ciphers.


3

Fixing files When you're limited to ftp access only on a system your only real option is to get/put files onto the device. But this turns out to often be all you need to "break" into a system. The approach you're going to want to take is to pull a file down to your local system, edit this file, and then put it back. /etc/passwd & /etc/shadow The files ...


3

There are 2 solutions using 2 different ftp servers 1 - Use proftpd with the VirtualServer feature and with a local user force. Snippet of a config file of mine: ServerType standalone DefaultServer on AccessGrantMsg "User %u logged in." DeferWelcome off # Use pam to authenticate (default) and be authoritative AuthPAMConfig proftpd AuthOrder ...


3

you can use mput * instead of put to upload all of the files in the directory. Further you can screen files, for example: mput *.jpg will transfer all and only jpg files.


2

To detect when a new file is created in or under a directory, use the inotify facility. See Can a bash script be hooked to a file? and How to run a command when a directory's contents are updated? for examples. Logging in to a website is very dependent on how the website manages authentication. Uploading the file is generally simple once you're ...


2

You could try using gnu parallel and curl to automate it. then you could do something such as: find . -t f -name "*.pdf" | parallel -j 4 curl -T {} ftp://ftp.site.com --user me:pass This will run 4 jobs per cpu uploading all pdfs in working path.


2

You can log sftp, try this: In /etc/ssh/sshd_config file, change this line: Subsystem sftp /usr/libexec/openssh/sftp-server to: Subsystem sftp /usr/libexec/openssh/sftp-server -l INFO -f AUTH Then config syslog log facility AUTH to your file. In Centos 6. edit /etc/rsyslog.conf, add this line: auth.* /var/log/sftp.log After ...


2

The SlackBuild makes it pretty easy: http://slackbuilds.org/repository/14.1/network/filezilla/ There is one required dependency, wxPython, which also has a SlackBuild: http://slackbuilds.org/repository/14.1/libraries/wxPython/ Download the source, wxPython-src-2.8.12.1.tar.bz2 and the SlackBuild, wxPython.tar.gz. From wherever you downloaded them to, # ...


2

Compile from source (according to wiki https://wiki.filezilla-project.org/Client_Compile ): Install dependencies: wxWidgets GnuTLS libidn gettext (Compiletime only) libdbus (under Unix-like systems) Download source package: http://sourceforge.net/projects/filezilla/files/FileZilla_Client/3.7.4.1/FileZilla_3.7.4.1_src.tar.bz2/download Exact source ...


2

Yes, in general the .netrc file should just work as you've described. It might be getting blocked by your FTP client not supporting it (perhaps it was explicitly built without this feature enabled). This would likely be done since this method of storing usernames/passwords is inherently insecure and should likely not be used. Checking with strace You can ...


2

On UNIX sytems usually Perl is already installed and Net::FTP is a Perl CORE module, e.g. is also installed. Then you could do without additional software (the grep is in the last line): perl -MNet::FTP -e ' $ftp = Net::FTP->new(q[ftp.example.com]) or die $!; $ftp->login(q[ftp],q[user@host]) or die $ftp->message; ...


2

It depends on your FTP server. For example, for pure-ftpd, you do it this way: Set the option CallUploadScript to yes (just create a file called /etc/pure-ftpd/conf/CallUploadScript and write yes in it) In /etc/default/pure-ftpd-common, add the path to the script you want to run on each upload after UPLOADSCRIPT=. Restart the service (# service pure-ftpd ...


2

I wrote this quick script: #!/bin/bash ssh "$1" "nc -l 2020 > \"$2\" &" pv "$2" | nc "$1" 2020 It takes two args, the host to send it to and the file you are sending. It only works for one file. It uses ssh to start a netcat listening on the opposite end and then uses netcat to send it to that listening port. I added pv to the start to give a nice ...


2

The only 2 methods I'm aware of where you can set this up so that Apache can see X number of users' content, but these same users are blind to each others' content is to use a separate Unix group for each user, that Apache is a member of as well or through ACLs. Method #1 - using groups Simply put each user into their own unique group (group1, group2, ...


2

This tutorial would seem to be what you're looking for, titled: Setup Virtual Users and Directories in VSFTPD. excerpt In /etc/vsftpd.conf. listen=YES anonymous_enable=NO local_enable=YES virtual_use_local_privs=YES write_enable=YES connect_from_port_20=YES secure_chroot_dir=/var/run/vsftpd pam_service_name=vsftpd guest_enable=YES user_sub_token=$USER ...


2

After about 3 hours, I think I figured out why it is not working. Selinux context public_content_t is required for files shared via an FTP server, unless associated with a user home directory and looks like /var/ftp/pub does not qualify for home directory. After I mounted ISO file, the security context of rhel changed to system_u:object_r:iso9660_t:s0 and ...



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