ERROR libunftp::server::controlchan::commands::pass] No such file or directory (os error 2)
i write a simple ftp server in libunftp, and impl the UserDetail for CustomUser
and impl Authenticator for CustomAuthenticator
but when run the program and visit it, it shows me the error above even i run the program by root user.
i tried these ways:
- run the program by root user
- sudo setenforce 0
- chmod 755 /path/
And the ftp dir is existing.
let home_dir = current_login_user.home_string();
debug!("------------------> home dir {}",&home_dir);
let server = libunftp::Server::with_authenticator(
Box::new(move || Filesystem::new(&home_dir)),
Arc::new(CustomAuthenticator::new(current_login_user))a
)
.greeting("Welcome to the ftp server^_^ ......")
.passive_ports(port_from..port_end)
.build()
.unwrap();
let _ = server.listen(format!("0.0.0.0:{}",port)).await
.expect("FTP server start failed!"); /
what should i do? Thanks very much!!!