connection remote server IP another is to log on to the remote server first, on the SFTP function 1, sftp [RemoteHost IP] via SFTP connection [host], the port is the default of 22, The user is currently logged on as a Linux user. Xshell 5 (Build 0806) Copyright (c) 2002-2015 Netsarang Computer, Inc. All rights reserved. Type ' help ' to learn. Xshell prompt. [c:
IP
The other is to log on to the remote server before opening the SFTP function
1, sftp [remotehost IP]
through the SFTP connection [host], the port is the default 22, the user is the Linux currently logged in user.
Xshell 5 (Build 0806)
Copyright (c) 2002-2015 Netsarang Computer, Inc. All rights reserved.
Type ' help ' to the learn how-to-use Xshell prompt.
[c
commands or a few, such as LS, LLS;CD, lcd;pwd, Lpwd, and so on. See the help output specifically.
SFTP is the secure file transfer program, which is based on SSH and is handy for passing documents between two Linux systems.
To deliver documents using SFTP, you should first turn on the SSH service on the server side, and if not, you can generally open it by using the following command:
#/etc/init.d/ss
# sftp-oport=22 dave@10.1.6.175
Connecting to 10.1.6.175 ...
dave@10.1.6.175 ' s Password:
Read from remote host 10.1.6.175:connection reset by peer
Couldn ' t read packet:connection reset by peer
Find connection not on, view log
The code is as follows:
[Root@localhost ftp]# Tail/var/log/messages
6 11:41:41 localhost sshd[4907]: Fatal:bad ownership or modes for chroot directory "/opt/ftp/dave"
6 11
-sftp
Reboot SSH4. Test access
The code is as follows:
root@10.1.1.200:test# sftp-oport=22 dave@10.1.6.175
Connecting to 10.1.6.175 ...
dave@10.1.6.175 ' s Password:
Read from remote host 10.1.6.175:connection reset by peer
Couldn ' t read packet:connection reset by peer
Find connection not on, view log
The code
#Specifies that the system comes with the INTERNAL-SFTP using the SFTP serviceMatch User www#match users, if you want to match multiple groups, separate multiple groups with commasChrootdirectory/home/www#with chroot will specify the user's root directory, meaning of chroot: http://www.ibm.com/developerworks/cn/linux/l-cn-chroot/Forcecommand internal-sftp#Specify
1. SFTP Credit Public key configuration1.1 Client-generated key pairTake the DSA Example:Ssh-keygen–t DSAAfter the command is executed, ID_DSA and id_dsa.pub two files are generated under the home/user name/.ssh directory1.2 willid_dsa.pubthe public key file is uploaded to the serverhome/User name/.sshdirectory underSCP id_dsa.pub username @ server-side ip:/home/user name/.sshYou also need to enter a password1.3 Adding a trusted public key to the serv
The most common ssh while SSH service is provided by SSHD when remotely landing on a Linux server, and sshd also provides SFTP functionality.
Here the user sftp-admin, only can sftp connect the server and cannot ssh to connect the server.
SFTP Connection: OKSSH Connection: NG
Create
Specifies that the Internal-sftpmatch user www #匹配用户 using the system comes with the SFTP service , and if multiple groups are to be matched, separate the chrootdirectory/home/www with commas between the groups # With chroot will specify the user's root directory, chroot meaning: Http://www.ibm.com/developerworks/cn/linux/l-cn-chroot/ForceCommand internal-sftp #指定
Specifies that the Internal-sftpmatch user www #匹配用户 using the system comes with the SFTP service, and if multiple groups are to be matched, separate the chrootdirectory/home/www with commas between the groups # With chroot will specify the user's root directory, chroot meaning: Http://www.ibm.com/developerworks/cn/linux/l-cn-chroot/ForceCommand internal-sftp #指定
Because customers in a recent project need to use SFTP to send files to me, the company's servers are WINDOWS 2003 or WINDOWS 2008, and I have to find a free one (this is important ), easy to use and stable SFTP server software.
After some painstaking efforts, I found the following:
1. OpenSSH
Reference article: "using sftp to Build Secure Transmission in Windows
SFTP command list for query. sftp command list
Available commands:
ascii Set transfer mode to ASCIIbinary Set transfer mode to binarycd path Change remote directory to 'path'lcd path Change local directory to 'path'detail remote-path Display system information about remote
Sample SFTP client code and sftp client codeSFTP client code example
Environment:Libssh2 1.4.3, zlib-1.2.8, openssl-1.0.1g
Author:Kagula
Last update date:
From Idea 2013, there are two projects in it. You only need to compile the libssh2 project. Before compilation, add the header files of zlib and openssl and the link location of the library file. If you are prompted to not find msvcrt. lib after compiling
Using the SFTP tutorial in PHP, PHP uses the SFTP tutorial
http://www.bkjia.com/PHPjc/976024.html www.bkjia.com true http://www.bkjia.com/PHPjc/976024.html techarticle PHP using the SFTP tutorial , PHP using the SFTP tutorial php/**php in the SFTP tutorial Telnet, FTP, S
, the maximum permissions can be set to 755.
Note: Because permissions are 755, which causes non-root users to write files in the directory, you need to set up subdirectories in the directory specified by Chrootdirectory, and then reset the owners and permissions.
Such as:
>
Chown
Suser:suser/var/opt/sftp/testdir
>
chmod
-R 755/var/opt/sftp/testdir
5. Test
>
Sftp
The first one:Java FTP uses Apache common-net, but FTP servers provided on the FTP service side only support SFTP, resultingJava.net.ConnectException:Connection refusedThe above error is on the company test server, the local running code error is as follows:org.apache.commons.net.MalformedServerReplyException:Could not parse response code. Server reply:ssh-2.0-openssh_5.3In summary: The use of Com.jcraft.jsch for
Use SFTP in Phpstorm and SFTP in Phpstorm
In Phpstorm, FTP connection failures often occur. In this case, we can use SFTP to connect to the server.
1. Add a server. Tools -- deployment -- configuration/browse Remote Host
2. Add a server and enter a name.
3. Enter the corresponding account and password port number, provided that the port and account have b
usernameX11forwarding Nochrootdirectory/data/htdocs/#指定实际目录Allowtcpforwarding NoForcecommand internal-sftp6. Modify PermissionsGroupadd SFTPuseradd-d/data-s/bin/false-g sftp yy (sftp account)passwd yy Modify User passwordChown Root.sftp/datachmod 750/data Note: Remember to give the owner of the directory to the root user. Cannot give the SFTP group user "W" perm
Linux sftp remote connection command sftp-oPort = 60001 the root@192.168.0.254 uses the-o option to specify the port number. -oPort = remote port number sftp> get/var/www/fuyatao/index. in php/home/fuyatao/, the index is stored in the/var/www/fuyatao/directory of the remote
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.