Chinaunix首页 | 论坛 | 博客
  • 博客访问: 713359
  • 博文数量: 235
  • 博客积分: 4309
  • 博客等级: 中校
  • 技术积分: 2325
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-17 11:25
个人简介

If you don\\\\\\\\\\\\\\\'t wanna do it, you find an EXCUSE; if you do, you\\\\\\\\\\\\\\\'ll find a WAY :-)

文章分类

全部博文(235)

文章存档

2014年(3)

2013年(2)

2012年(31)

2011年(199)

分类: LINUX

2011-09-30 20:02:25

1. Installation

  1. # 镜像选择
  2. # choose
  3. # debian-8.5.0-amd64-CD-1.iso    (含桌面等常用包)
  4. OR
  5. # debian-8.5.0-amd64-netinst.iso    (network install,base)
    1. # 安装过程使用english,source 一定要选 Primary Debian mirror sites, e.g. ftp.cn.debian.org  

  1. #Choose software to install    (我只勾选了如下两项)

  2. Debian desktop environment       (Gnome by default)
  3. Standard system utilities        


2. Update the packages list && Upgrade the packages 


  1. #配置 /etc/apt/sources.list
  2. # deb cdrom:[Debian GNU/Linux 8.5.0 _Jessie_ - Official amd64 CD Binary-1 20160604-15:35]/ jessie main

    # deb cdrom:[Debian GNU/Linux 8.5.0 _Jessie_ - Official amd64 CD Binary-1 20160604-15:35]/ jessie main

    # main

    deb jessie main contrib non-free

    deb-src jessie main contrib non-free

    # security

    deb http://security.debian.org/ jessie/updates main contrib

    deb-src http://security.debian.org/ jessie/updates main contrib

    # jessie-updates, previously known as 'volatile'

    deb jessie-updates main contrib non-free

    deb-src jessie-updates main contrib non-free


  3. 更新软件列表、升级软件包 
  4. $ apt-get update;apt-get upgrade
  5. OR
  6. aptitude update; aptitude safe-upgrade


3. Quick-start

  1. 配置网络 /etc/network/interfaces
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    source /etc/network/interfaces.d/*

    # The loopback network interface
    auto lo
    iface lo inet loopback

    #To use DHCP
    auto eth0
    allow-hotplug eth0
    iface eth0 inet dhcp
    iface eth0 inet6 dhcp

    # To use STATIC IP ADDRESS
    auto eth0
    iface eth0 inet static
     address 172.16.7.11
     netmask 255.255.255.0
     network 172.16.7.0 #network, broadcast and gateway are optional
     broadcast 172.16.7.255
     gateway 172.16.7.7
     dns-nameservers 223.5.5.5 223.6.6.6 #Place the line indented within an iface stanza, right after the gateway line.
     dns-domain debian.org


    配置 DNS /etc/resolv.conf
    search debian.org
    nameserver 10.1.1.36
    nameserver 192.168.9.100
    :wq

    $ cat /etc/hostname        (查看主机名)
    debian8

  2. $ su -
  3. # apt-get install sudo    (安装sudo)
  4. # adduser ko sudo; grep ko /etc/group
  5. # reboot    (OR    logout)

  6. $ sudo apt-get install locales
  7. $ sudo dpkg-reconfigure locales  (使用中文的后果是,man 都会显示中文,内容特别老)
  8. 区域语言选择:zh_CN.UTF-8
  9. 默认语言选择:en_US.UTF-8

  10. $ sudo apt-get install vim     (安装vim)
  11. 配置 ~/.vimrc
  12. set nocp

    "filetype off

    filetype plugin indent on

    syntax on

    set history=28

    set hls is

    set ic

    set autoindent

    "set cindent

    set nobackup

    set noswapfile

    set backspace=2

    set shiftwidth=1

    set tabstop=1

    set softtabstop=1

    set expandtab

    set ruler

    set mouse=v

    set showmatch

    set cursorline

    set fileencodings=utf-8

    set number

    "set showcmd

    "set autoread

    set foldmethod=syntax

    "set bg=dark

    "set laststatus=2


  13. $ sudo apt-get install openssh-server    (安装ssh server)
  14. $ scp -r ./debian-conf ko@172.16.7.X:~ko/    (拷贝之前的配置文件到remote server)
  15.             (# debian-conf包含我之前的配置文件:.bashrc .vimrc .zshrc interfaces resolv.conf sources.list)

  16. $ sudo apt-get install tmux    (安装tmux)

  17. # Automatically Starting tmux on SSH
  18. #
    ssh user@hostname -t tmux # create a new session, default name is 0
    ssh user@hostname -t tmux attach # it will prefer the most recently used unattached session.


    ssh user@hostname -t tmux attach -t target-session-name
    ssh user@hostname -t tmux attach -t 0 #Attach to target session 0


    ssh user@hostname -t -- /bin/sh -c 'tmux has-session && exec tmux attach-session || exec tmux'
  19. explanation below:
    #-- tells SSH that what follows is a command. Without this, you'll get a cryptic ssh_exchange_identification: Connection closed by remote host error.
    #/bin/sh -c allows us to use && and || in our command.
    #exec replaces the /bin/sh process with tmux so that we don't have an extra process hanging around. If you don't care about this, a simple 'tmux attach || tmux' will do.


    # 我自己用下面的方法
    ssh user@hostname -t "tmux attach-session -t ko || tmux new-session -s ko"
    #The tmux commands will connect to session ko if it already exists, or create a new session.

  20. $ sudo apt-get install git     (安装git,提示:git-core 已经obsolete)
  21. $ sudo apt-get install curl    (安装curl)
  22. $ sudo apt-get install zsh     (安装zsh)
  23. $ chsh -s $(which zsh); grep ko /etc/passwd
  24. $ sudo reboot

  25. Oh My Zsh Installation
  26. Reference
  27. 配置 ~/.zshrc
  28. alias wgetxx='wget -r -np -p -k -l 2'
    alias curlxx='curl -fsSL'
    alias ll='ls -l'
    alias la='ls -a'
    alias vi='vim'
    alias grep='grep --color=auto'
    alias -s html=vi
    alias -s rb=vi
    alias -s py=vi
    alias -s js=vi
    alias -s c=vi
    alias -s java=vi
    alias -s txt=vi
    alias -s gz='tar -zxvf'
    alias -s tgz='tar -zxvf'
    alias -s bz2='tar -jxvf'
    alias -s zip='unzip -d ./output/'
    alias cl='clear'
    alias clhistory='cat /dev/null > ~/.zsh_history'
    alias youtube='youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best''
    #alias youtube='youtube-dl --no-mtime -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best''


4. vsftpd setup
安装配置vsftpd服务:

  1. $ sudo apt-get install vsftpd (安装ftp服务)
  2. $ sudo grep ftp /etc/{passwd,group} (查找ftp账号家目录)
  3. /etc/passwd:ftp:x:112:119:ftp daemon,,,:/srv/ftp:/bin/false
  4. /etc/group:ftp:x:119:

  5. $ cd /srv/ftp; mkdir pub (创建pub文件夹)
  6. $ chown -R root:ftp /srv/ftp (修改ftp家目录访问权限)
  7. $ vim /etc/vsftpd.conf (修改ftp服务配置文件) 

  8. $ echo "welcome to yes4ko.com">/srv/ftp/pub/welcome.txt


5. Services Management
There are three simple utilities to manage your startup or init scripts
开机运行服务管理:
  1. /etc/init.d/vsftpd status (查看ftp服务状态)
  2. $ invoke-rc.d vsftpd status (相当于Redhat系列 service vsftpd status)

  3. $ aptitude install rcconf (相当于Redhat系列 setup)

  4. $ aptitude install sysv-rc-conf 
  5. $ sysv-rc-conf --level 2345 vsftpd on (相当于Redhat系列 chkconfig --level 2345 vsftpd on)

  6. $ update-rc.d vsftpd enable 2 3 4 5    (系统默认已安装)

6. Reserved for future use...

7. Reserved for future use...

8. Reserved for future use...

9. Reserved for future use...

10. Reserved for future use...

Reference: 


阅读(949) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~