sftp的安装和使用
来源:互联网 发布:mysql数据库脚本优化 编辑:程序博客网 时间:2024/05/18 03:30
http://blog.srmklive.com/2013/04/24/how-to-setup-sftp-server-ftp-over-ssh-in-ubuntu/
In my previous post, i discussed about how to install & configure FTP Server on Ubuntu. In this post, i will discuss about how to setup SFTP server in Ubuntu. First you need to install openssh-server, which can be done using command:
You can use the following commands for ssh:
First create a backup of the /etc/ssh/sshd_config file and name it as/etc/ssh/sshd_config.bak. When done, open the /etc/ssh/sshd_config file:
Now edit the file /etc/ssh/sshd_config and add/edit the following lines:
#Subsystem sftp /usr/lib/openssh/sftp-server
2
Subsystem sftp internal-sftp -f AUTH -1 VERBOSE
3
4
#Uncomment this line
if
already commented
5
UsePAM yes
6
7
AllowGroups sftpusers sftp root
8
9
Match Group sftpusers
10
ChrootDirectory %h
11
AllowTCPForwarding no
12
X11Forwarding no
13
ForceCommand internal-sftp
这里如果你想加入其他的用户test,并将它的目录限定在/home/test目录,需要加入如下的内容:
执行如下命令:sudo usermod -a -G sftpusers test再sshd_config中加入如下内容:Match user testChrootDirectory /home/testAllowTCPForwarding noX11Forwarding noForceCommand internal-sftp
为了不让test账户登录,可以设置/etc/passwd中的test账户为nologin。
Now lets create the relevant users & groups. First the create user group sftpusers using command:
Now create a user suppose sftpuser. The commands listed below will create the user, add it to the sftpusers, and update its password
Now proceed with modifying the permissions of the users home directory to allow for chrooting:
Create a directory in which sftpuser
is free to put any files in it:
- sftp的安装和使用
- Mac下ssh和sftp的使用
- Centos sshfs的安装和使用--将远程sftp目录映射到本地目录
- debian 6.0 默认安装后,无法使用sftp的解决办法
- subime安装和连接sftp
- 使用 Spring Batch 和 SFTP 安全的发送数据
- WinScp、Scrt的使用和相关SSH、SFTP概念解析
- sftp脚本使用的问题
- [置顶]SFTP服务的使用!!
- JAVAWEB开发之——Linux命令实战、虚拟机和centos的安装以及联网、常用命令、vi编辑以及软件的安装、sftp的使用
- FTPS和SFTP的区别
- SFTP 和FTPS的区别
- SCP 和 SFTP 的区别
- linux 的 sftp 和 scp
- sftp和ftp的区别
- FTP和SFTP的区别
- FTP和SFTP的区别
- shell的sftp和ftp
- python urllib2的proxyhandler
- unbuntu下vnc和vnc2swf的使用
- linux 屏幕录像(recordmydesktop)
- linux下python启动第三方程序,并控制关闭
- x11vnc
- sftp的安装和使用
- 如何用crontab运行一个图形化界面的程序
- 根据ip查询地区,经纬度等-geoip2
- mysql 支持中文,防止程序乱码的方法
- poj 2318 TOYS(判断点在多边形内+二分查找)
- mysql 常用命令(备忘)
- 加盐密码哈希:如何正确使用(转载)
- linux 如何让程序后台执行
- jbpm显示当前流程执行到那里