Tag Info

Hot answers tagged

7

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


6

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


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

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 always use the lftp client which has the ability to resume a download that either died midstream or that I want to cancel and later restart. I usually use the command like so: $ lftp -e "mirror /download/<dir> /local/<dir>" -u user -p <port> ftp.server.com What else? This tool's name is a bit misleading, it can handle either FTP or ...


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

If you're using lftp you can use the Tab key to do path completion similar to the same method used when in a shell such as Bash or Zsh. If you continue to hit Tab as you type it will complete as much of what matches. You can continue to type additional characters from the results of what's left that matches what you're typed thus far. Example Initially ...


3

For SSH: tar czf - . | ssh remote "( cd /somewhere ; cat > file.tar.gz )" For SFTP: outfile=/tmp/test.tar.gz tar cvf $outfile . && echo "put $outfile" | sftp remote:/tmp/ Connecting to remote... Changing to: /tmp/ sftp> put /tmp/test.tar.gz Uploading /tmp/test.tar.gz to /tmp/test.tar.gz /tmp/test.tar.gz Another SFTP: ...


3

I think it depends more on the client that you're using. Take a look at the client, lftp. There's a good tutorial on using it here, titled: Unix: Flexibly moving files with lftp. If you look through the help for lftp you'll notice the command mv. $ lftp lftp :~> help !<shell-command> (commands) ...


3

Adding NEW fixed it, I believe. Now, my iptables file look like this.. # Generated by iptables-save v1.3.5 on Thu Oct 3 22:25:54 2013 *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [824:72492] -A INPUT -p tcp -m tcp --dport 21 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT -A INPUT -p tcp -m tcp --dport 20 -m conntrack --ctstate ...


3

There is most likely a NAT-firewall between you and the servers showing the symptom. (NAT-firewalls hide a whole network behind a single IP-number). The problem is that ftp wants to send the data resulting from the command in a new, separate TCP/IP connection and that cannot go through the firewall because it needs to go from the server to you, and you are ...


3

With zsh: autoload zfinit zfinit zmodload zsh/datetime files=N*.TXT zfopen $host $user $passwd && zfcd $remotedir && zfrglob files && for f ($files) { t=$EPOCHREALTIME strftime -s ts %H%M%S ${t%.*} ts=$ts.${t#*.} zfgcp -Gt $f N_$ts.TXT } zfclose


3

ftp doesn't strike me as the appropriate tool to do this with. I'd try lftp instead. As you have it scripted the line: nmap N*.TXT N_`date "+%H%M%N"`.TXT Get's evaluated once, and then expanded to the current date, from then on it's only going to be used as the expanded form. What you want to do is get the remote side to do this expansion for you, ...


3

The best way, is to use SFTP from SSH and jail the user. in file: /etc/ssh/sshd_config make sure this line is uncomented: Subsystem sftp internal-sftp Then configure the rule to match a group: Match group sftponly ChrootDirectory /home/%u X11Forwarding no AllowTcpForwarding no ForceCommand internal-sftp and lastly ...


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

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

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.


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

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


2

The easy way to do complex things with FTP is to not deal with FTP. Mount the FTP resource as a filesystem. FUSE is widely available nowadays, even on servers with restricted software configurations. You can use Curlftpfs to mount FTP directories. mkdir /net/someftp.example.com curlftpfs -o user=bob someftp.example.com /net/someftp.example.com Store the ...


2

Well, i did some sort of Mixed implementation, based on the answers of Stephane and slm. I couldn't use zsh because is a production server and installing a new shell is not an option, so, i used lftp that was installed: Explanation: On the first here_docs(FTP_LIST) connect on the ftp server and list the files(nlist). If the listing was successfull( if [ $? ...


2

The simple solution is to switch Filezilla to use passive mode when connecting to that FTP server. When you connect to FTP you use port 21 which is known as the control channel. This is the connection used to send commands and receive notifications on the results of the commands issued. Note that for file listings (the output to LIST), file transfer ...


2

Could you try this chown -R ftpusername /var/www/html


2

IMO, it's a way how lftp client works. Check the log file /var/log/secure (on RHEL/CentOS) or similar for events like pam_listfile(vsftpd:auth): Refused user root for service vsftpd I verified such behavior by sniffing FTP traffic (RHEL 6.x, vsftpd 2.2.2, lftp 4.0.9). The FTP connection is not established till you enter some valid FTP command (aka ls) ...


2

you can try playing with : cmds_allowed This options specifies a comma separated list of allowed FTP commands (post login. USER, PASS and QUIT and others are always allowed pre-login). Other commands are rejected. This is a powerful method of really locking down an FTP server. Example: cmds_allowed=PASV,RETR,QUIT Default: (none) cmds_denied ...


2

There is no absolute answer here, as FTP protocol in itself does not include such a mechanism. There is however, FTP protocol commands with no real meanings on a given situation like "NOOP", "LIST" or "CWD" which can be used to keep the FTP connection alive. So this is up to the client itself to implement such a mechanism using these "meaningless" commands ...


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.



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