• 2008-06-21

    安装telnet/ssh和ftp服务 - [软件与系统]

    Tag:Linux

    版权声明:转载时请以超链接形式标明文章原始出处和作者信息及本声明
    http://feizf.blogbus.com/logs/23351643.html

    一. 安装telnet服务器
    1. sudo apt-get install xinetd telnetd

    2. sudo vi /etc/xinetd.conf并加入以下内容:
    # Simple configuration file for xinetd
    #
    # Some defaults, and include /etc/xinetd.d/
    defaults
    {
    # Please note that you need a log_type line to be able to use log_on_success
    # and log_on_failure. The default is the following :
    # log_type = SYSLOG daemon info
    instances = 60
    log_type = SYSLOG authpriv
    log_on_success = HOST PID
    log_on_failure = HOST
    cps = 25 30
    }

    includedir /etc/xinetd.d

    3.创建文件/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
    log_on_failure += USERID
    }

    4. 重启机器或重启网络服务sudo /etc/init.d/xinetd restart

    二. 乱码问题
        用PuTTY登录Linux后时,默认使用的是utf-8字符集,而我们常用的win 2000、xp系统使用的是GBK字符集,这就是乱码的原因.
    在windows下telnet会有中文乱码问题, 可以使用Putty 設定:
    (1)Window\Apperance\Font Settings 字型選細明體,字集選CHINESE_BIG5
    (2)Window\Translation\Character set translation on recived data選UFT-8
    这样就不会有乱码了

    三. ubuntu上安装ssh服务器和客户端

    安装
    # sudo apt-get install openssh-server openssh-client
    登录远端ssh服务器
    # ssh user@your-server-ip-address

    开启/停止服务
    # sudo /etc/init.d/ssh stop
    # sudo /etc/init.d/ssh start
    # sudo /etc/init.d/ssh restart

    在ubuntu下ssh登录远端可能会很长延迟才能login, 解决办法:

    编辑 /etc/ssh/ssh_config 文件,将
    GSSAPIAuthentication yes
    改成
    GSSAPIAuthentication no
    即可。

    原因:
    The default ssh_config file comes with GSSAPIAuthentication set
    to "yes".  This causes a DNS query in an attempt to resolve
    _kerberos.<hostname> whenever ssh is invoked.  During periods when
    connectivity to the outside world is interrupted for whatever reason,
    the ssh session won't proceed until the DNS query times out.  Not really
    a problem, just more of an annoyance when trying to ssh to another
    machine on the LAN.

    来源  http://blog.chinaunix.net/u/21684/showart_389925.html 

    四. 安装vsftpd   (added on 2009.2.14, 9.04)

    kissgnu@kissgnu-laptop:~$ sudo apt-get install vsftpd

    这样安装好了之后,默认情况下创建了/home/ftp文件夹,用ftp://xx连到本机可以匿名进入这个目录。

     

    下面要对vsftpd.conf进行配置

    kissgnu@kissgnu-laptop:~$ sudo cp /etc/vsftpd.conf  /etc/vsftpd.conf.bk

    kissgnu@kissgnu-laptop:~$ sudo vim /etc/vsftpd.conf

     

    anonymous_enable=NO    (如果允许匿名访问,那么选择YES)

     

    local_enable=YES   (允许本地的Linux帐户访问这个ftp服务器)

    write_enable=YES   (本地的 LInux帐户访问时,可写)

     

    (下面限定某些用户只能在指定的目录范围内活动,不让起越界乱跑)

    chroot_list_enable=YES

    chroot_list_file=/etc/vsftpd.chroot_list  (在另外的/etc/vsftpd.chroot_list文件中添加限制的用户)

    ftpd_banner="Welcome to KissGNU'S FTP".  (设置用户登录的欢迎信息)

     

    重新启动vsftpd

    kissgnu@kissgnu-laptop:~$ sudo /etc/init.d/vsftpd restart

     


    收藏到:Del.icio.us




    引用地址:

    评论

  • 狐男应用方面有待加强啊
    kissGNU回复covariant说:
    是啊是啊 太弱了 呵呵
    2008-06-23 16:16:03