嵌入式ftp和telnet环境搭建

2019-07-12 14:29发布

=========================vsftpd==========================================
1.安装 vsftpd
apt-get install vsftpd

2.配置 vsftpd.conf
vi /etc/vsftpd.conf (可以参考我的另一篇配置文件详解)

3.ftp路径配置
打开passwd
vi /etc/passwd
找到ftp开头的  我的是ftp:x:105:110:ftp daemon,,,:/srv/ftp:/bin/false
其中/srv/ftp为目录 可以修改

修改权限 主目录为755 内容777 chmod 775 /srv/ftp    /* 修改自己的 */
chmod 777 /srv/ftp/* -R    /* ftp下有资源的时候 */
重启服务
service vsftpd restart
=========================telnet==========================================
1.安装服务
apt-get install telnetd
apt-get install telnetd-ssl
apt-get install xinetd
新建一个文件/etc/xinetd.d/telnet,内容如下,并保存
vi /etc/xinetd.d/telnet                     
# default: on
# description: The telnet server serves telnet sessions; it uses \
#       unencrypted username/password pairs for authentication.
service telnet
{
        disable = no
        flags           = REUSE
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/sbin/in.telnetd
        server_args     = -h
        log_on_failure  += USERID
}
本来因为telnet是明文传输的,所以处于安全考虑才限制了root从telnet登陆,如果你需要使用,那么如下修改
vi /etc/pam.d/login
#把下面在行注释掉
# auth       requisite  pam_securetty.so
打开配置文件:vi /etc/securetty;在文件末尾添加pts/0
重启服务
service xinetd restart

PC端
sudo telnet 192.168.1.114
Trying 192.168.1.114...
Connected to 192.168.1.114.
Escape character is '^]'.
debian login: root
Last login: Thu Jan  1 00:00:24 UTC 1970 on ttymxc0
Linux debian 3.14.38 #2 SMP PREEMPT Tue Oct 18 15:27:39 CST 2016 armv7l

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
RTNETLINK answers: File exists
root@debian:~#
root@debian:~#
root@debian:~#
root@debian:~# ls
tmp
root@debian:~# cd /
root@debian:/# ls
bin  boot  dev    etc  home  include  lib  media    mnt  opt  proc    root  run  sbin  srv  sys  tmp    usr  var
root@debian:/#

相关文档参考网址
/* ftp telnet */
http://blog.csdn.net/u014213012/article/details/52198990
http://wenku.baidu.com/link?url=sju6UkfIfWhmEIWcrrjq963UDWFwfte4kCnCEkNznXMNBWNko0CxKURk1OnUV5hw6hJKyLyRRDVtBI3KIp4wrq-FjtZzxUGHdD8RL2wV6my
http://www.cnblogs.com/9426yu/p/4835443.html
http://blog.sina.com.cn/s/blog_4e790d510100bzns.html
http://jingyan.baidu.com/article/c74d6000668e440f6a595df3.html