Hot answers tagged

35

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


19

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 rejected modprobe ip_conntrack_ftp Allow FTP connections on port 21 incoming and ...


18

It's quite simple. You have to add the following option on the vsftpd.conf file chroot_local_user=YES The documentation inside the configuration file is self-explanatory: # You may specify an explicit list of local users to chroot() to their home # directory. If chroot_local_user is YES, then this list becomes a list of # users to NOT chroot(). This ...


15

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


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


13

Give this a try: $ lftp lftp :~> set ftp:ssl-force true lftp :~> connect ftp.domain.tld lftp ftp.domain.tld:~> login <username> NOTE: If the server is making use of self signed certificates you may need to add this set as well: lftp :~> set ssl:verify-certificate no


13

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


12

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


11

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


10

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


10

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


10

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


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


9

The command ftp put /path/to/local_file doesn't work with vsftpd. Try the following: ftp put /path/to/local_file remote_file_name You may choose any name you wish for the remote_file_name, but you must specify one.


9

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


9

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: outfile=/tmp/test....


8

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


7

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


7

from man ftp on my CentOS If auto-login is enabled, ftp will check the .netrc (see below) file in the user’s home directory for an entry describing an account on the remote machine. If no entry exists, ftp will prompt for the remote machine login name (default is the user identity on the local machine), and, if necessary, ...


7

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.


7

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


7

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.


7

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.


7

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.


7

There is a post here that describes the problem. The new kernel module seccomp is used automatically by vsftpd since version 3.0.0. vsftpd is a bit buggy when using seccomp. Add this line to the end of /etc/vsftpd.conf seccomp_sandbox=NO and restart the Server: sudo service vsftpd restart


6

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


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

Usually, ftp command line clients support the configuration file ~/.netrc where you can configure credentials for remote systems, e.g.: machine legacy.system.example.org login juser password keins When you ftp legacy.system.example.org then you don't have to retype this information anymore. If you need to do more automation, you can script ftp via piping ...


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



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