[Topic DIscussion] 有没有简单的图形化sftp服务器?
Tofloor
poster avatar
兴安
deepin
2021-12-01 04:03
Author

像core ftp mini sftp这样简单的

Reply Favorite View the author
All Replies
188******80
deepin
2021-12-01 04:31
#1

试试finalshell?我百度到的,没用过

Reply View the author
兴安
deepin
2021-12-01 04:36
#2

finalshell是远程登录服务器吧

我是想把电脑做服务器,只要简单一些的,能提供sftp服务即可

Reply View the author
neko
Moderator
2021-12-01 04:46
#3
兴安

finalshell是远程登录服务器吧

我是想把电脑做服务器,只要简单一些的,能提供sftp服务即可

sftp你直接useradd创建个账号再设置个密码就能用了啊....

Reply View the author
babyfengfjx
Super Moderator
CQA
2021-12-01 17:12
#4

实际上用命令的方式也是非常稳定和简单的,不知道下面这段文字是否有帮助:

SFTP&NFS&FTP协议的服务器搭建方法

分享目的

按照搭建方法,可以高效的搭建各种协议的服务器场景,避免繁琐的配置工作.

搭建方法

类型1:SFTP服务器搭建方法 --验证可行

【1】群组配置---服务端

1.groupadd sftp

2.cat /etc/group

3.sudo vi /etc/group 修改 sftp:X :1002

**3. useradd -g sftp -s /bin/false mysftp **

4.passwd mysftp (设置新密码为服务器访问密码)

【2】共享目录---服务端

mkdir -p /data/sftp/mysftp

usermod -d /data/sftp/mysftp mysftp

【3】配置文件修改---服务端

vi /etc/ssh/sshd_config

Subsystem sftp /usr/libexec/openssh/sftp-server (该行原本配置,需要手动注释掉)

并在文件最后面添加如下几行内容然后保存

Subsystem sftp internal-sftp

Match Group sftp

ChrootDirectory /data/sftp/%u

ForceCommand internal-sftp

AllowTcpForwarding no

X11Forwarding no

【4】目录授权与新建---服务端

chown root:sftp /data/sftp/mysftp

chmod 755 /data/sftp/mysftp

mkdir /data/sftp/mysftp/upload

chown mysftp:sftp /data/sftp/mysftp/upload

chmod 755 /data/sftp/mysftp/upload

【5】重启服务---服务端

systemctl restart sshd.service

【6】访问服务器---客户端

进入文件管理器或我的电脑

输入---例如sftp://10.20.32. (根据实际服务端IP输入,并键如账号密码,即可访问)**

类型2:NFS服务器搭建方法

【1】NFS服务相关安装包安装---服务端

sudo apt-get install nfs-kernel-server # 安装 NFS服务器端

sudo apt-get install nfs-common # 安装 NFS客户端

【2】添加共享客户端IP控制---服务端

sudo vim /etc/exports

添加

*/nfsroot (rw,sync,no_root_squash) # * 表示允许任何网段 IP 的系统访问该 NFS 目录

切忌:不可配置为,IT会发现并要求整改*

常规可根据测试环境配置为 例如:10.20.35.0/24 (0/24即指该网段内所有的IP)

【3】添加NFS文件共享目录---服务端

创建共享目录,并增加权限

sudo mkdir /nfsroot

sudo chmod -R 777 /nfsroot

sudo chown ipual:ipual /nfsroot/ -R # ipual 为当前用户,-R 表示递归更改该目录下所有文件

【4】服务重启并检查---服务端

sudo systemctl restart nfs-kernel-server.service

sudo systemctl status nfs-kernel-server.service

以上为服务端配置完成

【5】客户端访问---客户端

测试端需要安装nfs相关客户端与服务

sudo apt install nfs-common libnfs-utils

方法:

终端输入:sudo mount 10.20.35.56:/nfsroot ./1

PS:

IP ---根据实际测试时电脑实际IP进行变更

./1 ---文件夹根据实际测试端文件夹名定义

类型3:FTP服务器搭建方法

【服务端】

**FTP环境搭建 访问 **file:///run/user/1000/gvfs/smb-share:server=10.20.12.250,share=share/测试脚本

获取 vsftp.sh脚本 直接在服务器端运行即可

【客户端】

进入文件管理器或我的电脑

输入---例如ftp://10.20.32. (根据实际服务端IP输入,选择匿名访问,即可进入服务器)**

另一种配置方式

vsftpd配置使用

概述

vsftpd 是Linus上非常安全好用的ftp服务,只需要简单的安装后就可以搭建起ftp服务;

该服务主要的配置文件就是vsftpd.conf ,在deepin/uos系统中的绝对路径是:/etc/vsftpd.conf

安装

# 只需要简单的进行安装配置即可,前提是你开启了开发者模式我们才能通过终端安装软件
sudo apt install vsftpd


# 如果提示没有找到对应安装包,则可能是没有进行仓库的更新连接,执行如下命令即可
sudo apt update 

服务的启停配置

# 启动服务
service vsftpd start
# 停止服务
service vsftpd stop
# 重启服务
service vsftpd restart
# 查看服务状态
service vsftpd status
#执行后结果如下:active则表示正常运行,如果失败了则可以通过提示信息查询对应问题
babyfengfjx@babyfengfjx:~$ service vsftpd status 
● vsftpd.service - vsftpd FTP server
   Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2021-10-09 16:22:48 CST; 1s ago
  Process: 18334 ExecStartPre=/bin/mkdir -p /var/run/vsftpd/empty (code=exited, status=0/SUCCESS)
 Main PID: 18335 (vsftpd)
    Tasks: 1 (limit: 4915)
   Memory: 568.0K
   CGroup: /system.slice/vsftpd.service
           └─18335 /usr/sbin/vsftpd /etc/vsftpd.conf

配置文件展示

**在使用该服务过程中,主要就是这些配置文件该如何配置,很多同学在实际配置过程中很难一次配置成功,这里就给出一个实际可用的配置参数以供参考 **

下面就是基于uos安装的3.0.3-12版本附带的原配置文件进行的配置

**配置过程中尽量是将匿名登录关闭,使用本地用户登录,以确保安全。 **

# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
#
# Run standalone?  vsftpd can run either from an inetd or as a standalone
# daemon started from an initscript.
listen=YES
#
# This directive enables listening on IPv6 sockets. By default, listening
# on the IPv6 "any" address (::) will accept connections from both IPv6
# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6
# sockets. If you want that (perhaps because you want to listen on specific
# addresses) then you must run two copies of vsftpd with two configuration
# files.
listen_ipv6=NO
#
# Allow anonymous FTP? (Disabled by default).
anonymous_enable=NO
#
# Uncomment this to allow local users to log in.
local_enable=YES
#
# Uncomment this to enable any form of FTP write command.
write_enable=YES
#
# Default umask for local users is 077. You may wish to change this to 022,
# if your users expect that (022 is used by most other ftpd's)
#local_umask=022
#
# Uncomment this to allow the anonymous FTP user to upload files. This only
# has an effect if the above global write enable is activated. Also, you will
# obviously need to create a directory writable by the FTP user.
#anon_upload_enable=YES
#
# Uncomment this if you want the anonymous FTP user to be able to create
# new directories.
#anon_mkdir_write_enable=YES
#
# Activate directory messages - messages given to remote users when they
# go into a certain directory.
dirmessage_enable=YES
#
# If enabled, vsftpd will display directory listings with the time
# in  your  local  time  zone.  The default is to display GMT. The
# times returned by the MDTM FTP command are also affected by this
# option.
use_localtime=YES
#
# Activate logging of uploads/downloads.
xferlog_enable=YES
#
# Make sure PORT transfer connections originate from port 20 (ftp-data).
connect_from_port_20=YES
#
# If you want, you can arrange for uploaded anonymous files to be owned by
# a different user. Note! Using "root" for uploaded files is not
# recommended!
#chown_uploads=YES
#chown_username=whoever
#
# You may override where the log file goes if you like. The default is shown
# below.
#xferlog_file=/var/log/vsftpd.log
#
# If you want, you can have your log file in standard ftpd xferlog format.
# Note that the default log file location is /var/log/xferlog in this case.
#xferlog_std_format=YES
#
# You may change the default value for timing out an idle session.
#idle_session_timeout=600
#
# You may change the default value for timing out a data connection.
#data_connection_timeout=120
#
# It is recommended that you define on your system a unique user which the
# ftp server can use as a totally isolated and unprivileged user.
#nopriv_user=ftpsecure
#
# Enable this and the server will recognise asynchronous ABOR requests. Not
# recommended for security (the code is non-trivial). Not enabling it,
# however, may confuse older FTP clients.
#async_abor_enable=YES
#
# By default the server will pretend to allow ASCII mode but in fact ignore
# the request. Turn on the below options to have the server actually do ASCII
# mangling on files when in ASCII mode.
# Beware that on some FTP servers, ASCII support allows a denial of service
# attack (DoS) via the command "SIZE /big/file" in ASCII mode. vsftpd
# predicted this attack and has always been safe, reporting the size of the
# raw file.
# ASCII mangling is a horrible feature of the protocol.
#ascii_upload_enable=YES
#ascii_download_enable=YES
#
# You may fully customise the login banner string:
#ftpd_banner=Welcome to blah FTP service.
#
# You may specify a file of disallowed anonymous e-mail addresses. Apparently
# useful for combatting certain DoS attacks.
#deny_email_enable=YES
# (default follows)
#banned_email_file=/etc/vsftpd.banned_emails
#
# You may restrict local users to their home directories.  See the FAQ for
# the possible risks in this before using chroot_local_user or
# chroot_list_enable below.
# chroot_local_user=YES
#
# You may specify an explicit list of local users to chroot() to their home
# directory. If chroot_local_user is YES, then this list becomes a list of
# users to NOT chroot().
# (Warning! chroot'ing can be very dangerous. If using chroot, make sure that
# the user does not have write access to the top level directory within the
# chroot)
# chroot_local_user=YES
# chroot_list_enable=YES
# (default follows)
# chroot_list_file=/etc/vsftpd.chroot_list
#
# You may activate the "-R" option to the builtin ls. This is disabled by
# default to avoid remote users being able to cause excessive I/O on large
# sites. However, some broken FTP clients such as "ncftp" and "mirror" assume
# the presence of the "-R" option, so there is a strong case for enabling it.
#ls_recurse_enable=YES
#
# Customization
#
# Some of vsftpd's settings don't fit the filesystem layout by
# default.
#
# This option should be the name of a directory which is empty.  Also, the
# directory should not be writable by the ftp user. This directory is used
# as a secure chroot() jail at times vsftpd does not require filesystem
# access.
secure_chroot_dir=/var/run/vsftpd/empty
#
# This string is the name of the PAM service vsftpd will use.
pam_service_name=vsftpd
#
# This option specifies the location of the RSA certificate to use for SSL
# encrypted connections.
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO


#
# Uncomment this to indicate that vsftpd use a utf8 filesystem.
#utf8_filesystem=YES

实际开启的配置项如下:

**按照如下简单的配置就可以通过本地用户进行访问了 **

listen=YES
listen_ipv6=NO
anonymous_enable=NO
local_enable=YES
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
ssl_enable=NO

遇到的问题

  • 无法配置指定根目录,也就是任何本地账户登录后的目录都是根目录,无法自定义配置指定目录,配置后也不生效;
  • 在添加新用户配置成nologin时,是无法正常使用该类用户进行访问的;
  • 添加的新用户,需要先登录一次后,方可使用该账号访问ftp;
Reply View the author
t***n@foxmail.com
deepin
2021-12-01 17:56
#5

用remmina,协议选sftp

Reply View the author
uvz
deepin
2021-12-01 19:09
#6

filezilla server

Reply View the author
兴安
deepin
2021-12-01 23:27
#7
uvz

filezilla server

这个server没有linux版本

Reply View the author