我希望将SFTP用户限制在他们的主文件夹中,这样他们就不会看到其他人的文件夹/主目录。不幸的是,所有SFTP用户目前都可以看到其他用户的文件夹。所有的帖子和例子都指出了ChrootDirectory,但由于某种原因,我无法让它发挥作用。
$ sudo nano /etc/ssh/sshd_config
Subsystem sftp internal-sftp
Match Group sftp
ChrootDirectory %h # The %h causes "Broken pipe" error while trying to login
C
是否可以通过python运行以下步骤?
我的目标是通过python -登录到13.5.41.90 (LinuxMachineRedHat5.3)来实现sftp的自动化,并从这个Linux获得file.txt,请给我建议?
sftp 13.5.41.90
Password: password123
cd /var/tmp
get file.txt
sftp> quit
the full view from sftp command line
sftp 13.5.41.90
Connecting to 13.5.41.90...
Passw
具有以下软件的
Linux服务器:
- Ubuntu 10.04 LTS x64
- Linux kernel 2.6.38
需要以下配置/软件:
- SSH through rsa key authentication
- SFTP with the following properties:
- Single user
- Access to ONLY /var/www (no home directory what so ever)
- Rsa key authentication
服务器将在互联网上,所以它需要是安全的。我该怎么做呢?我被SFTP用户的配置卡住了
目标:限制用户访问主目录和家庭中的符号链接目录。
我在sshd_config中尝试了以下配置
# Subsystem sftp /usr/lib/openssh/sftp-server
Subsystem sftp internal-sftp
Match user matt
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
然后重新启动sshd。用户不能使用正确的密码登录。连接拒绝身份验证失败。
我在/etc/security/limits.conf s.conf中做了修改
test hard maxlogins 2
sftptest hard maxlogins 2
在上面的条目之后,我在下面的场景中进行了测试
打开两个putty会话,当我试图打开第三个会话时,它会自动断开连接(与ssh用户工作良好,而不是sftp用户)
打开2个putty会话,当我试图从filezilla/winscp连接中打开第三个会话时(与ssh用户正常工作)3.当我试图在filezilla / winscp中打开3个会话时,我可以打开3个会话(不工作)
我有两个服务器帐户(同一大学Linux服务器的两个学生用户帐户)。我想使用SFTP命令在它们之间传输文件。
我尝试使用$ ssh user1@server_host登录第一个用户帐户,然后尝试连接第二个用户帐户并访问我想要使用$ sftp user2@server_host:/path/to/files传输的文件,接下来我想使用$ get /path/to/files/file.txt将文件从user2获取到user1。
但是sftp user2@server_host:/path/to/files显示了错误:ssh: connect to host gw.cse.cuhk.edu.hk po
我有个用户被关进监狱。
sshd_config:
Subsystem sftp internal-sftp
Match user matt
ChrootDirectory %h
X11Forwarding no
AllowTcpForwarding no
护照:
matt:x:1001:5006:Matt Ryan,,,:/home/matt:/home/matt/bin/bash
这对于sftp来说是完美的。用户被限制在他的主文件夹,和任何安装在那里。
但是,我也想让这个使用shell访问。当他们试图登录时会发生这样的情况:
$ ssh matt@server
我有一个安装了plesk控制面板的CentOS服务器,我使用带有根密码的SFTP登录来管理文件。但是,突然之间,我无法使用SFTP访问服务器,并且在使用CuteFTP时会出现此错误。
ERROR:> [4/18/2012 5:18:31 PM] Connection to the server was lost, and the operation could not be performed.
ERROR:> [4/18/2012 5:18:31 PM] Can't connect to localkicks.com:22. SFTP21 error =