Chinaunix首页 | 论坛 | 博客
  • 博客访问: 713407
  • 博文数量: 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

2014-08-30 14:00:46

1. 系统安装

  1. FROM: https://www.debian.org/releases/stable/amd64/index.html.zh-cn
  2. Attention: 安装过程中,语言如果选择了“简体中文”,安装完成后命令行man手册会直接调用中文版本。
2. 基础配置

网络配置:

  1. root@debian7:~# vi /etc/network/interfaces
  2. # To use dhcp: 

    # auto eth0 
    # iface eth0 inet dhcp 


    # An example static IP setup: (broadcast and gateway are optional) 

    # auto eth0
    # iface eth0 inet static 
    # address 192.168.0.42 
    # network 192.168.0.0 
    # netmask 255.255.255.0 
    # broadcast 192.168.0.255 
    # gateway 192.168.0.1
    :wq

    root@debian7:~# vim /etc/resolv.conf    (配置DNS)
    search debian.org
    nameserver 10.1.1.36
    nameserver 192.168.9.100
    :wq

  3. root@debian7:~# cat /etc/hostname        (查看主机名)
  4. debian7
命令别名:

  1. root@debian7:~#  vi ~/.bashrc
    # some more ls aliases
    alias ll='ls -l'
    alias la='ls -A'
    alias l='ls -CF'
    :wq

  2. root@debian7:~# source ~/.bashrc
    root@debian7:~#  alias
    alias l='ls -CF'
    alias la='ls -A'
    alias ll='ls -l'
    alias ls='ls --color=auto'

添加语言支持:

  1. root@debian7:~# locale            (查看当前语言)
  2. LANG=zh_CN.UTF-8
  3. LANGUAGE=
  4. LC_CTYPE="zh_CN.UTF-8"
  5. LC_NUMERIC="zh_CN.UTF-8"
  6. LC_TIME="zh_CN.UTF-8"
  7. LC_COLLATE="zh_CN.UTF-8"
  8. LC_MONETARY="zh_CN.UTF-8"
  9. LC_MESSAGES="zh_CN.UTF-8"
  10. LC_PAPER="zh_CN.UTF-8"
  11. LC_NAME="zh_CN.UTF-8"
  12. LC_ADDRESS="zh_CN.UTF-8"
  13. LC_TELEPHONE="zh_CN.UTF-8"
  14. LC_MEASUREMENT="zh_CN.UTF-8"
  15. LC_IDENTIFICATION="zh_CN.UTF-8"
  16. LC_ALL=


  17. 添加locales 多语言支持:
  18. root@debian7:~# aptitude install locales
  19. root@debian7:~# dpkg-reconfigure locales

  20. 自动改为:en_US.UTF-8
  21. root@debian7:~# more /etc/default/locale
  22. # File generated by update-locale
  23. LANG=en_US.UTF-8
  24. LANGUAGE="en_US:en"

软件包管理系统:
  1. root@debian7:~# cp /etc/apt/sources.list /etc/apt/sources.list.bak
  2. root@debian7:~# vi /etc/apt/sources.list            (配置包管理系统)
  3. # Base repository
  4. deb wheezy main contrib non-free
  5. deb-src wheezy main contrib non-free

  6. # Security updates
  7. deb http://security.debian.org/ wheezy/updates main contrib non-free
  8. deb-src http://security.debian.org/ wheezy/updates main contrib non-free

  9. # wheezy-updates,previously known as 'volatile'
  10. deb wheezy-updates main contrib non-free
  11. deb-src wheezy-updates main contrib non-free

  12. # apt-get(aptitude) 以此文件中列出的路径索引实现软件包管理
软件包更新:


  1. root@debian7:~# apt-get update                                (更新软件包列表)
  2. root@debian7:~# apt-get dist-upgrade                          (安装系统更新)

  3. root@debian7:~# aptitude update                                (更新软件包列表)
  4. root@debian7:~# aptitude dist-upgrade                          (安装系统更新)
安装配置vim 文本编辑器:

  1. root@debian7:~# apt-get install vim -y                        (安装vim文本编辑器)
  2. root@debian7:~# vim ~/.vimrc                                    (调整vim功能开关)
    set nomodeline                (这个一定要写,目前有这个安装漏洞)
    set nocp
    set hls is
    set ic
    set cindent
    set autoindent
    set backspace=2
    set nobackup
    set noswapfile
    set shiftwidth=2
    set tabstop=2
    set softtabstop=2
    set expandtab
    set ruler
    set mouse=v
    syntax on
    "set bg=dark                (更改背景色调/默认为light, " 为注释!)
    :wq               (详情:vimtutor)

安装配置vsftpd服务:

  1. root@debian7:~# apt-get install vsftpd (安装ftp服务)
  2. root@debian7:~# 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. root@debian7:~# cd /srv/ftp; mkdir pub (创建pub文件夹)
  6. root@debian7:~# chown -R root:ftp /srv/ftp (修改ftp家目录访问权限)
  7. root@debian7:~# vim /etc/vsftpd.conf (修改ftp服务配置文件)

  8. root@debian7:~# echo "welcome to yes4ko.com">/srv/ftp/pub/welcome.txt

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

  3. root@debian7:~# aptitude install rcconf (相当于Redhat系列 setup)

  4. root@debian7:~# aptitude install sysv-rc-conf
  5. root@debian7:~# sysv-rc-conf --level 2345 vsftpd on (相当于Redhat系列 chkconfig --level 2345 vsftpd on)

  6. root@debian7:~# update-rc.d vsftpd enable 2 3 4 5    (系统默认已安装)
sudo:

  1. root@debian7:~# apt-get install sudo       (安装sudo)
  2. root@debian7:~adduser ko sudo        (将用户ko添加到sudo组中)
  3. Adding user `ko' to group `sudo' ...
  4. Adding user ko to group sudo
  5. Done.
  6. root@debian7:~# grep ko /etc/group
  7. cdrom:x:24:ko
  8. floppy:x:25:ko
  9. sudo:x:27:ko
  10. ...
  11. ...
  12. ko:x:1000:

  13. 注销电脑,重新以账号ko登入。

  14. ko@debian7:~# ifconfig            (该命令仅允许拥有管理员权限的用户访问)
  15. bash: ifconfig: command not found
  16. ko@debian7:~# sudo ifconfig        (回显将得到网卡信息)
  17. ...
  18. ...


10> Reserved for future use....



阅读(2267) | 评论(0) | 转发(0) |
0

上一篇:Raspberry Pi 获取公网地址

下一篇:没有了

给主人留下些什么吧!~~