Tag Info

New answers tagged

1

You can also use password less connections, just use public/private key and you are ready to go. Using lftp client you can establish connections giving username/password as a parameter in the command line lftp sftp://sftp_server -uuser,password


0

Maybe your SFTP client does not know how to mirror directories. Though there are other SFTP clients. You might want to install a different one or a newer version of your client. The SFTP client in the RedHat package openssh-clients-6.4, for example, knows the -r option. This is how I got the version of my SFTP client: rpm -qf /usr/bin/sftp Apart from ...


1

Use put -r. The sftp client in openssh-clients-6.4 knows the -r option, some older clients don't. You might also want to have a look at the -p option (preserve).


0

There is another way which I wound up using.. Try using rsync. We find the following: If you specify no local destination then a listing of the specified files on the remote server is provided. The BASH script then becomes: #!/bin/bash localpath=/home/local-acct/path remotelocation=/home/account/logs/archive remotehost=' account@1.2.3.4' rsync -avz ...


2

The sftp command is very limited. If you can't make it do what you want, you can use another approach, which is to mount the remote directory with the SSHFS filesystem. SSHFS uses SFTP as the transport protocol, so the server side just sees an SFTP client. You need to be able to use FUSE on the client side. With SSHFS, you mount the remote directory onto an ...


1

The dir command within sftp client does not support redirection. Example below, showing how it does nothing. sftp> pwd Remote working directory: /var/tmp/foodir sftp> lcd /var/tmp/foodir sftp> dir *.* foo.txt sftp> dir *.* >dirlist.txt foo.txt sftp> dir foo.txt sftp> Man page for sftp confirms. ls [-1afhlnrSt] [path] ...


2

Your syntax for the Subsystem keyword is wrong. Try this instead: Subsystem internal-sftp Match Group nas ChrootDirectory %h ForceCommand internal-sftp AllowTcpForwarding no If you take a look at /var/log/auth.log on your server (yes, I know that's localhost in your case) you will see messages like this: Jul 7 22:46:24 localhost ...



Top 50 recent answers are included