Skip to content

Ubuntu 装机指南

Guang Chen edited this page Mar 24, 2015 · 13 revisions

Ubuntu 装机指南

本文适用对象: SA

安装

按照安装说明即可。请注意如果RAID或LVM尝试失败,则务必不要浪费时间,使用默认的LVM分区即可。

安装时注意在选择软件时要使用空格选择openssh

网络

dhcp

auto eth0
iface eth0 inet dhcp

注意把eth0换成实际的网卡名

static

auto eth0
iface eth0 inet static
address xxx.xxx.xxx.xxx
netmask xxx.xxx.xxx.xxx
gateway xxx.xxx.xxx.xxx
dns-nameservers xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx

ssh

  1. 首先添加ssh public key, 在$HOME下创建.ssh目录,并在.ssh目录中添加authorized_keys文件,文件内容为ssh public key.
  2. 测试此时ssh登陆是否需要密码
  3. 用root权限编辑/etc/ssh/sshd_config,找到# PasswordAuthentication yes改为PasswordAuthentication no
  4. sudo service ssh restart,并在没有key的机器上尝试登陆,应当显示Permission denied (publickey).
  5. 编辑sshd_config修改端口Port 22为其他端口

用户

添加用户

sudo adduser username

添加到sudo用户组

sudo adduser username sudo

注意,由于禁止了密码登陆,需要为该用户添加.ssh/authorized_keys, 添加时务必先sudo su username切换到该用户

换源(14.04)

校内tuna源v4

deb http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu trusty main restricted
deb-src http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu trusty main restricted
deb http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu trusty-updates main restricted
deb-src http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu trusty-updates main restricted
deb http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu trusty universe
deb-src http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu trusty universe
deb http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu trusty-updates universe
deb-src http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu trusty-updates universe
deb http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu trusty multiverse
deb-src http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu trusty multiverse
deb http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu trusty-updates multiverse
deb-src http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu trusty-updates multiverse
deb http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu trusty-backports main restricted universe multiverse
deb-src http://mirrors.4.tuna.tsinghua.edu.cn/ubuntu trusty-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse

tuna v6

deb http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu trusty main restricted
deb-src http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu trusty main restricted
deb http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu trusty-updates main restricted
deb-src http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu trusty-updates main restricted
deb http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu trusty universe
deb-src http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu trusty universe
deb http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu trusty-updates universe
deb-src http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu trusty-updates universe
deb http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu trusty multiverse
deb-src http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu trusty multiverse
deb http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu trusty-updates multiverse
deb-src http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu trusty-updates multiverse
deb http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu trusty-backports main restricted universe multiverse
deb-src http://mirrors.6.tuna.tsinghua.edu.cn/ubuntu trusty-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse

北交大ipv6

deb http://mirror.bjtu.edu.cn/ubuntu/ trusty main restricted
deb-src http://mirror.bjtu.edu.cn/ubuntu/ trusty main restricted
deb http://mirror.bjtu.edu.cn/ubuntu/ trusty-updates main restricted
deb-src http://mirror.bjtu.edu.cn/ubuntu/ trusty-updates main restricted
deb http://mirror.bjtu.edu.cn/ubuntu/ trusty universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ trusty universe
deb http://mirror.bjtu.edu.cn/ubuntu/ trusty-updates universe
deb-src http://mirror.bjtu.edu.cn/ubuntu/ trusty-updates universe
deb http://mirror.bjtu.edu.cn/ubuntu/ trusty multiverse
deb-src http://mirror.bjtu.edu.cn/ubuntu/ trusty multiverse
deb http://mirror.bjtu.edu.cn/ubuntu/ trusty-updates multiverse
deb-src http://mirror.bjtu.edu.cn/ubuntu/ trusty-updates multiverse
deb http://mirror.bjtu.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirror.bjtu.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse