In linux, for security purposes, we disable some users from logging on to the system through SSH. Here I will take the centos operating system as an example to record how to handle it.
1. Open the sshd configuration file
vi/etc/ssh/sshd_config
2. modify the configuration file and add or modify the following lines:
# User user1 login prohibited, separated by Spaces
DenyUsers user1
# Prohibit all users of group1 from logging on. Separate multiple Spaces
DenyGroups group1
3.
In Python, you can use the SFTP in the Paramiko module to login to the remote host for upload and download functions.
1. Function implementation According to the input parameters to determine whether the file or directory, upload and download local parameters locally need to be the same as remote parameter remoted type, file end with filename, directory with \ End upload and download local and remote directories need to have exception capture
2. Code
# (#号为注释符, that is, do not take effect), if the default is no after the corresponding item is changed to YesNote: If you are not logged in by using the root account yourself then do not modify the PermitRootLogin option to include the previous # number.5, after the completion of the modification will be sshd_config uploaded and overwritten the original file on the server, overwriting the successful restart SSH service:[Email protected]. SSH] # service sshd Restart /bin/systemctl restart
number of connections.
Limitconnectionbyuser/limitconnectionbyip limits the maximum number of connections of each user/IP address.
Home specifies where the user directory is.
At this time, for example, test1 user, modify/etc/passwd. Change to mysecureshell as follows:
650) This. width = 650; "style =" background-image: none; padding-left: 0px; padding-Right: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px; "Title =" clip_image004 "border =" 0 "alt
Purpose
1) Support for SFTP protocol2) do not use the System Account Verification Method. Instead, use the MySQL database for verification.3) No Password is saved in the database. Only the 16-bit lowercase string that has been encrypted by the sha256 algorithm can be printed. A salt file must be saved in the system.4) Specify the user directory in the database, and ProFTPD can dynamically create User DirectoriesModify the SSH service port number to 21
much.BVSSH: I'm using it, and it's good, and there's an SFTP window open.4, Ftp/sftpFile Transfer Protocol for the application layer files Transfer Protocol, Secure file Transfer ProtocolThe port used to send the command is typically 21, and the port used to transmit the data is 20FTP is a specific application of TCP/IP, which works on the seventh layer of the OSI model, on the fourth layer of the TCP model, the application layer, using TCP instead o
SecureCRT sftp upload/download files
Remote Login IP
Click Sftp in the SECURECRT session
3.cd/home/dowload Linux platform switch to/home/dowload directory4.CD D:\ Windows platform switches to D drive5.put file name uploaded under/home/dowload directory6.get file name download files to Windows platform D DriveThis article is from the "12069831" blog, please be sure to keep this source http://1
FTP is a client software for one-pass file transfer or upload/download. SSH is a secure remote management protocol, including a file transfer function similar to FTP, that is, SFTP, which is very useful.The most convenient software is winscp.However, if you do not use this function, you can use FlashXP directly. This software also supports this SFTPThe usage of FTP is the same as that of FTP.Select SFTP in
To start the FTP service:Yum Install vsftpdUnder the/etc/rc.d/init.d/directory: Command service vsftp startStart SSH service, SFTP serviceUnder the/etc/init.d/directory: command/etc/init.d/sshd start note that you need to execute the sshd start in the absolute pathThe ability to enable root to connect via FTP software:The default is that some users cannot connect to the server via FTP, such as root. If you need to turn on these users, you need to make
Used to WINSCP and xftp directly connected to the server to modify the file, to Linux gnome or KDE found no WINSCP to provide the interface of the client, went to a filezilla, but the libstdc++ version of CentOS is too old to support.The original Linux file Manager comes with this feature, just open the File Manager, click on the connection server, enterSftp://[email protected]:22 directly connected to the server SFTP, with the basic use of the same,
about SFTPSFTP is an interactive file transfer protocol, similar to FTP, but it is encrypted for transmission and is more secure than FTP. SFTP Usagelocalhost>sftp root@177. 222.123. -get a file or directory from a remote host to a local directorySFTP>/Home/remote/index/home/local/upload a local directory or file to the remote directorySFTP>/home/local/index/home/ Remote/Common operations:querying the curr
SFTP available Commands: CD path change remote directory to "path" LCD path change local directory to "path" CHGRP Group path Change the group of the file "path" to "group" chmod mode path changes the permissions of the file "path" to "mode" chown owner path will change the master of the file "path" to " Owner "Exit exit Sftphelp Show this help textGetRemote Path Download file ln existingpath linkpath symbolic link remote file ls [options] [path] Disp
#!/usr/bin/env pythonImportParamikoImportSys,oshost='git' #IP地址或在hosts文件中绑定主机名IPUser='Root' #系统用户名Password='123' #密码s=Paramiko. Sshclient () #ssh实例s. Load_system_host_keys () #load本机的s. Set_missing_host_key_policy (Paramiko. Autoaddpolicy ()) #防止以前没连接过客户端主机, which means that there is no record of the corresponding client host in the known_hosts on the server and the error T= Paramiko. Transport ((host,22) #主机地址和端口t. Connect (username=user,password=password) #用户名和密码#pkey_file = '/root/.ssh/id_rsa
The SSH service has a SFTP service that is based on the SSH protocol FTP service, but is more secure than FTP. We can connect using Xshell software, SECURECRT, or xftp, where xftp is fully graphical operation.
Xftp Download Address: http://www.onlinedown.net/soft/143.htm
Create a new connection in xftp, note that the protocol needs to select SFTP, and then fill in the IP, account, and password and connect
The SSH service has a SFTP service that is based on the SSH protocol FTP service, but is more secure than FTP. We can connect using Xshell software, SECURECRT, or xftp, where xftp is fully graphical operation.
Create a new connection in xftp, note that the protocol needs to select SFTP, and then fill in the IP, account, and password and connect to log in sequentially.
The default entry is in the us
Linux Normal management, is the use of SSH service, this situation without the installation of PUREFTPD or VSFTPD software, such as the use of the SFTP function, to upload or download the files in the cloud host, recommend software: FLASHFXP or Filezilla, can be. Port, username, password, direct use of SSH can be.
First, the use of FLASHFXP (most webmaster have)
Second, the use of FileZilla (supporting multiple files at the same time upload, suitabl
1.putty Official DownloadHttp://www.chiark.greenend.org.uk/~sgtatham/putty/download.htmlDownload the installation versionputty-0.67-installer.msi2. After the installation is complete, open the Putty installation directory, locate the PSFTP.EXE, and copy to the new folder D:/download3. Double-click Open Pstftp.exe, connect to Linux Server4. Set up a local directory to download to Windows5.psftp common commands (files on the operation server are common commands for Linux)
lcd+ path: Chang
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.