Linux installation Sftp

Source: Internet
Author: User
Tags bz2 clear screen ftp client

1,SFTP: Login Command
xshell:\> sftp [email protected]


Connecting to 192.168.159.128:22 ...
Connection established.
To escape to local shell, press ' ctrl+alt+] '.

Your current Local Directory is
C:\Program Files\netsarang\xshell 4

2,help command
Sftp:/root> Help
Bye finish your SFTP session
CD change your remote working directory
Clear Clear Screen
Exit Finish your SFTP session
Explore explore your local directory
Get download a file from the server to your local machine
Help Give Help
LCD change and/or print local working directory
LLS List contents of a local directory
LPWD Print your local working directory
LS List contents of a remote directory
mkdir Create a directory on the remote server
MV Move or rename a file on the remote server
Put upload a file from your local machine to the server
PWD Print your remote working directory
Quit Finish your SFTP session
Rename move or rename a file on the remote server
RM Delete a file
RmDir remove a directory on the remote server


3,sftp Account
SFTP supanccy123

4, installing SFTP
Redhat Fedora Series System
Client Yum Install OpenSSH
Server Yum Install Openssh-server


5. See if the OPENSS software is installed
[Email protected] ~]# rpm-q openssh-server
openssh-server-5.3p1-94.el6.i686
[Email protected] ~]#


6,SFTP Configuration
, add user groups

Copy Code code example:
Groupadd SFTP
2. Add user and set as SFTP group

Copy Code code example:
sudo useradd-g sftp-s/sbin/nologin-m sftp
3, modify the SFTP user's password

Copy Code code example:
sudo passwd sftp
***********
4. Create the root directory of the SFTP user and set the owner and group, modify permissions (755)

Copy Code code example:
Cd/home
sudo mkdir sftp

sudo chown root:sftp sftp
sudo chmod 755 sftp
5. Create an admin writable directory in the SFTP directory

Copy Code code example:
CD SFTP
sudo mkdir report
sudo chown admin:sftp report/
6. Modify the configuration file

Copy Code code example:
sudo vim/etc/ssh/sshd_config
Modify
#Subsystem Sftp/usr/libexec/openssh/sftp-server
Subsystem sftp internal-sftp
7. Last added in Sshd_config file

Copy Code code example:
Match User SFTP
X11forwarding No
Allowtcpforwarding No
Forcecommand internal-sftp
Chrootdirectory/home/sftp
8. Restart the SSHD service

Copy Code code example:
sudo service sshd restart
FTP client:
address:192.168.1.10
User:sftp
Password:xxxxxxx
Protocol TYPE:SSH2
Port:22
Server folder:/home/sftp
pls use cuteftp Pro? 8.3.3 or last version.
Because CuteFTP Pro? 8.3.2 or earlier has no AES128 and AES256 ciphers.
Would raise throw "SFTP21 error = #4".




9, uninstall Opernssh-server
[Email protected] ~]# rpm-q openssh-server
openssh-server-5.3p1-94.el6.i686
[Email protected] ~]# rpm-e openssh-server-5.3p1-94.el6.i686
Warning:/etc/ssh/sshd_config saved As/etc/ssh/sshd_config.rpmsave
[Email protected] ~]# rpm-e openssh-server-5.3p1-94.el6.i686
Error:package openssh-server-5.3p1-94.el6.i686 is not installed
[Email protected] ~]# rpm-q openssh-server
Package openssh-server are not installed


10,linux Software Uninstall
Configure function: is the source to install the software when the configuration environment with him according to your configuration options and your system situation to generate makefile files for make preparation

Most commonly used parameters:./configure--prefix Effect:

If you do not specify prefix, the executable file is placed by default in/usr/local/bin, and the library file is placed by default in/usr/local/lib, and the configuration file is placed by default in/usr/local/etc. Other resource files are placed in the/usr/local/share. You want to uninstall this program, either in the original make directory with the made uninstall (if the make file specified uninstall), or go to the above directory to delete the relevant files by hand. Specify prefix, delete a folder directly is enough.

Installation of software

There are two main types of software installation in Linux. The first installation file is named Xxx.tar.gz, and the other installation file is named xxx.i386.rpm. Most of the software issued in the first way is sent in the form of source code, and the second method is sent directly in binary form.

For the first type, the installation method is as follows:

1. First, copy the installation files to your directory. For example, if you are logged on as root, copy the software to/root.

#cp Xxx.tar.gz/root

2. Because the file is compressed and packaged, it should be uncompressed. The command is:

#tar Xvzf filename.tar.gz If it is in filename.tar.bz2 format, it should be tar jxvf filename.tar.bz2 to decompress

3. After the command is executed, the installation files are extracted by path and are decompressed in the current directory. You can see the extracted files with the LS command. Typically, files that are generated after decompression have "Install" files. This file is a plain text file, detailing how the package is installed.

4. An executable script named configure that was generated after the decompression was performed. It is used to check whether the system has a library that is required for compilation, and whether the version of the library meets the required system information for installation such as compilation. Prepare for the subsequent compilation work. The command is: #./configure

If you want to install the software to the specified directory, you should use #./configure--prefix=/your own designated directory, for example, I want to install a mlterm into the/opt/mlterm directory, should be entered as follows

#./configure--prefix=/opt/mlterm

5. After the check passes, a makefile file is generated for compilation. At this point, you can start compiling. The process of compiling depends on the size of the software and the performance of the computer, and the time spent is different. The command is: #make.

6. After successful compilation, type the following command to start the installation:

#make Install

7. After installation, the files generated during the compilation process should be cleared for temporary files and configuration. Type the following command:

#make Clean

#make Distclean

This concludes the installation of the software.

For the second, the installation method is much simpler.

As in the first way, copy the installation files to your directory. Then use RPM to install the file. The command is as follows:

#rpm-I. filename.i386.rpm

RPM will automatically unpack the installation files and install the software into the default directory. and register the installation information of the software in the RPM database. The function of the parameter i is to get the RPM into the installation mode.

Uninstalling the Software

1. The uninstallation of the software is mainly done using RPM. To uninstall the software, first know the name of the package registered in the system. Type the command:

#rpm-Q-A

You can query to all packages installed on the current system.

2. Determine the name of the software to be uninstalled, you can begin to actually uninstall the software. Type the command:

#rpm-E [package name]

You can uninstall the software. The function of the parameter e is to allow the RPM to enter the Unload mode. Uninstall the package named Packages name. Because of the dependencies between the various packages in the system. If there is a dependency that cannot be uninstalled, RPM will give you a hint and stop uninstalling. You can use the following command to ignore dependencies and start unloading directly:

#rpm-E [package name]-nodeps

Ignoring dependencies may cause other software in the system to become unusable

If you want to know where the RPM package is installed?

should use #rpm-QL [package name]

3. How to uninstall software installed with the source code package?

It is best to look at the Readme and install, the general situation has said, but most of the software does not provide the source package unloading method; We can find the installation point of the software to remove. It depends on where you have installed it.

Like what:

If you are installing the software, specify a directory. This problem is not difficult;

For example, using the source package to install Gaim

#./configure--prefix=/opt/gaim

#make

#make Install

If you install Mlterm

#./configure--prefix=/opt/mlterm

#make

#make Install

The source package installs the software, all specifies installs in the/OPT directory, so does not know??

If deleted, delete the corresponding software catalog;

Some software to perform make uninstall in the Unzip installation directory, so uninstall



View installed Openssh-server and clients
[[email protected] ~]# rpm-qa|grep SSH
openssh-5.3p1-94.el6.i686
libssh2-1.4.2-1.el6.i686
openssh-askpass-5.3p1-94.el6.i686
openssh-server-5.3p1-94.el6.i686
openssh-clients-5.3p1-94.el6.i686
[Email protected] ~]#
Or
[Email protected] ~]# Rpm-qa|grep OpenSSH
openssh-5.3p1-94.el6.i686
openssh-askpass-5.3p1-94.el6.i686
openssh-server-5.3p1-94.el6.i686
openssh-clients-5.3p1-94.el6.i686
[Email protected] ~]#

Original article

Linux installation Sftp

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.