-
FROM: https://www.debian.org/releases/stable/amd64/index.html.zh-cn
- Attention: 安装过程中,语言如果选择了“简体中文”,安装完成后命令行man手册会直接调用中文版本。
网络配置:
- root@debian7:~# vi /etc/network/interfaces
-
# 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 -
root@debian7:~# cat /etc/hostname (查看主机名)
- debian7
-
root@debian7:~# vi ~/.bashrc
# some more ls aliases
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
:wq -
root@debian7:~# source ~/.bashrc
root@debian7:~# alias
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -l'
alias ls='ls --color=auto'
-
root@debian7:~# locale (查看当前语言)
-
LANG=zh_CN.UTF-8
-
LANGUAGE=
-
LC_CTYPE="zh_CN.UTF-8"
-
LC_NUMERIC="zh_CN.UTF-8"
-
LC_TIME="zh_CN.UTF-8"
-
LC_COLLATE="zh_CN.UTF-8"
-
LC_MONETARY="zh_CN.UTF-8"
-
LC_MESSAGES="zh_CN.UTF-8"
-
LC_PAPER="zh_CN.UTF-8"
-
LC_NAME="zh_CN.UTF-8"
-
LC_ADDRESS="zh_CN.UTF-8"
-
LC_TELEPHONE="zh_CN.UTF-8"
-
LC_MEASUREMENT="zh_CN.UTF-8"
-
LC_IDENTIFICATION="zh_CN.UTF-8"
-
LC_ALL=
-
-
-
添加locales 多语言支持:
-
root@debian7:~# aptitude install locales
-
root@debian7:~# dpkg-reconfigure locales
-
-
自动改为:en_US.UTF-8
-
root@debian7:~# more /etc/default/locale
-
# File generated by update-locale
-
LANG=en_US.UTF-8
-
LANGUAGE="en_US:en"
-
- root@debian7:~# cp /etc/apt/sources.list /etc/apt/sources.list.bak
- root@debian7:~# vi /etc/apt/sources.list (配置包管理系统)
- # Base repository
- deb wheezy main contrib non-free
- deb-src wheezy main contrib non-free
-
- # Security updates
- deb http://security.debian.org/ wheezy/updates main contrib non-free
- deb-src http://security.debian.org/ wheezy/updates main contrib non-free
-
- # wheezy-updates,previously known as 'volatile'
- deb wheezy-updates main contrib non-free
- deb-src wheezy-updates main contrib non-free
-
- # apt-get(aptitude) 以此文件中列出的路径索引实现软件包管理
-
-
root@debian7:~# apt-get update (更新软件包列表)
- root@debian7:~# apt-get dist-upgrade (安装系统更新)
-
- root@debian7:~# aptitude update (更新软件包列表)
- root@debian7:~# aptitude dist-upgrade (安装系统更新)
- root@debian7:~# apt-get install vim -y (安装vim文本编辑器)
-
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)
-
root@debian7:~# apt-get install vsftpd (安装ftp服务)
-
root@debian7:~# grep ftp /etc/{passwd,group} (查找ftp账号家目录)
-
/etc/passwd:ftp:x:112:119:ftp daemon,,,:/srv/ftp:/bin/false
-
/etc/group:ftp:x:119:
-
-
root@debian7:~# cd /srv/ftp; mkdir pub (创建pub文件夹)
-
root@debian7:~# chown -R root:ftp /srv/ftp (修改ftp家目录访问权限)
-
root@debian7:~# vim /etc/vsftpd.conf (修改ftp服务配置文件)
-
- root@debian7:~# echo "welcome to yes4ko.com">/srv/ftp/pub/welcome.txt
There are three simple utilities to manage your startup or init scripts:
开机运行服务管理:
-
root@debian7:~# /etc/init.d/vsftpd status (查看ftp服务状态)
-
root@debian7:~# invoke-rc.d vsftpd status (相当于Redhat系列 service vsftpd status)
-
- root@debian7:~# aptitude install rcconf (相当于Redhat系列 setup)
-
-
root@debian7:~# aptitude install sysv-rc-conf
- root@debian7:~# sysv-rc-conf --level 2345 vsftpd on (相当于Redhat系列 chkconfig --level 2345 vsftpd on)
-
- root@debian7:~# update-rc.d vsftpd enable 2 3 4 5 (系统默认已安装)
- root@debian7:~# apt-get install sudo (安装sudo)
- root@debian7:~# adduser ko sudo (将用户ko添加到sudo组中)
- Adding user `ko' to group `sudo' ...
- Adding user ko to group sudo
- Done.
- root@debian7:~# grep ko /etc/group
- cdrom:x:24:ko
- floppy:x:25:ko
- sudo:x:27:ko
- ...
- ...
- ko:x:1000:
-
- 注销电脑,重新以账号ko登入。
-
- ko@debian7:~# ifconfig (该命令仅允许拥有管理员权限的用户访问)
- bash: ifconfig: command not found
- ko@debian7:~# sudo ifconfig (回显将得到网卡信息)
- ...
- ...
10> Reserved for future use....