特殊:Badtitle/NS100:Installation/OverSSH/zh:修订间差异
新页面: {{Translation}} {{From|https://help.ubuntu.com/community/Installation/OverSSH}} {{Translator|Yaoms}} {{Languages|UbuntuHelp:Installation/OverSSH}} /!\ 请注意,这是一个正在实验... |
小无编辑摘要 |
||
第1行: | 第1行: | ||
{{Translation}} {{From|https://help.ubuntu.com/community/Installation/OverSSH}} {{Translator|Yaoms}} {{Languages|UbuntuHelp:Installation/OverSSH}} | {{Translation}} {{From|https://help.ubuntu.com/community/Installation/OverSSH}} {{Translator|Yaoms}} {{Languages|UbuntuHelp:Installation/OverSSH}} !! 请注意,这是一个正在实验中的项目,它不是很成熟,并且有可能搞坏您的系统。 | ||
=== 警告 === | === 警告 === | ||
第16行: | 第16行: | ||
<pre># fdisk /dev/hda | <pre># fdisk /dev/hda | ||
</pre> | </pre> | ||
切记要把root分区设为活动分区(可以启动的) | 切记要把root分区设为活动分区(可以启动的)!在稍後的介绍中,我将假设你使用下面的分区布局,请根据你自己的情况改变。 | ||
<pre>/dev/hda1 (83 Linux) - for /, | <pre>/dev/hda1 (83 Linux) - for /, | ||
/dev/hda2 (82 Linux swap) - as swap | /dev/hda2 (82 Linux swap) - as swap | ||
第136行: | 第136行: | ||
default 0 | default 0 | ||
timeout 3 | timeout 3 | ||
第156行: | 第172行: | ||
kernel /vmlinuz root=/dev/hda1 | kernel /vmlinuz root=/dev/hda1 | ||
initrd /initrd.img | initrd /initrd.img | ||
第192行: | 第240行: | ||
grub> setup (hd0) | grub> setup (hd0) | ||
grub> quit | grub> quit | ||
第229行: | 第309行: | ||
# umount /mnt/ubuntu/dev | # umount /mnt/ubuntu/dev | ||
第250行: | 第354行: | ||
# umount /mnt/ubuntu | # umount /mnt/ubuntu | ||
第271行: | 第399行: | ||
# reboot | # reboot | ||
2008年1月9日 (三) 12:09的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/Installation/OverSSH }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/af | • {{#if: UbuntuHelp:Installation/OverSSH|Afrikaans| [[::Installation/OverSSH/zh/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/ar | • {{#if: UbuntuHelp:Installation/OverSSH|العربية| [[::Installation/OverSSH/zh/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/az | • {{#if: UbuntuHelp:Installation/OverSSH|azərbaycanca| [[::Installation/OverSSH/zh/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/bcc | • {{#if: UbuntuHelp:Installation/OverSSH|جهلسری بلوچی| [[::Installation/OverSSH/zh/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/bg | • {{#if: UbuntuHelp:Installation/OverSSH|български| [[::Installation/OverSSH/zh/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/br | • {{#if: UbuntuHelp:Installation/OverSSH|brezhoneg| [[::Installation/OverSSH/zh/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/ca | • {{#if: UbuntuHelp:Installation/OverSSH|català| [[::Installation/OverSSH/zh/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/cs | • {{#if: UbuntuHelp:Installation/OverSSH|čeština| [[::Installation/OverSSH/zh/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/de | • {{#if: UbuntuHelp:Installation/OverSSH|Deutsch| [[::Installation/OverSSH/zh/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/el | • {{#if: UbuntuHelp:Installation/OverSSH|Ελληνικά| [[::Installation/OverSSH/zh/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/es | • {{#if: UbuntuHelp:Installation/OverSSH|español| [[::Installation/OverSSH/zh/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/fa | • {{#if: UbuntuHelp:Installation/OverSSH|فارسی| [[::Installation/OverSSH/zh/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/fi | • {{#if: UbuntuHelp:Installation/OverSSH|suomi| [[::Installation/OverSSH/zh/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/fr | • {{#if: UbuntuHelp:Installation/OverSSH|français| [[::Installation/OverSSH/zh/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/gu | • {{#if: UbuntuHelp:Installation/OverSSH|ગુજરાતી| [[::Installation/OverSSH/zh/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/he | • {{#if: UbuntuHelp:Installation/OverSSH|עברית| [[::Installation/OverSSH/zh/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/hu | • {{#if: UbuntuHelp:Installation/OverSSH|magyar| [[::Installation/OverSSH/zh/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/id | • {{#if: UbuntuHelp:Installation/OverSSH|Bahasa Indonesia| [[::Installation/OverSSH/zh/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/it | • {{#if: UbuntuHelp:Installation/OverSSH|italiano| [[::Installation/OverSSH/zh/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/ja | • {{#if: UbuntuHelp:Installation/OverSSH|日本語| [[::Installation/OverSSH/zh/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/ko | • {{#if: UbuntuHelp:Installation/OverSSH|한국어| [[::Installation/OverSSH/zh/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/ksh | • {{#if: UbuntuHelp:Installation/OverSSH|Ripoarisch| [[::Installation/OverSSH/zh/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/mr | • {{#if: UbuntuHelp:Installation/OverSSH|मराठी| [[::Installation/OverSSH/zh/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/ms | • {{#if: UbuntuHelp:Installation/OverSSH|Bahasa Melayu| [[::Installation/OverSSH/zh/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/nl | • {{#if: UbuntuHelp:Installation/OverSSH|Nederlands| [[::Installation/OverSSH/zh/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/no | • {{#if: UbuntuHelp:Installation/OverSSH|norsk| [[::Installation/OverSSH/zh/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/oc | • {{#if: UbuntuHelp:Installation/OverSSH|occitan| [[::Installation/OverSSH/zh/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/pl | • {{#if: UbuntuHelp:Installation/OverSSH|polski| [[::Installation/OverSSH/zh/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/pt | • {{#if: UbuntuHelp:Installation/OverSSH|português| [[::Installation/OverSSH/zh/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/ro | • {{#if: UbuntuHelp:Installation/OverSSH|română| [[::Installation/OverSSH/zh/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/ru | • {{#if: UbuntuHelp:Installation/OverSSH|русский| [[::Installation/OverSSH/zh/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/si | • {{#if: UbuntuHelp:Installation/OverSSH|සිංහල| [[::Installation/OverSSH/zh/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/sq | • {{#if: UbuntuHelp:Installation/OverSSH|shqip| [[::Installation/OverSSH/zh/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/sr | • {{#if: UbuntuHelp:Installation/OverSSH|српски / srpski| [[::Installation/OverSSH/zh/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/sv | • {{#if: UbuntuHelp:Installation/OverSSH|svenska| [[::Installation/OverSSH/zh/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/th | • {{#if: UbuntuHelp:Installation/OverSSH|ไทย| [[::Installation/OverSSH/zh/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/tr | • {{#if: UbuntuHelp:Installation/OverSSH|Türkçe| [[::Installation/OverSSH/zh/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/vi | • {{#if: UbuntuHelp:Installation/OverSSH|Tiếng Việt| [[::Installation/OverSSH/zh/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/yue | • {{#if: UbuntuHelp:Installation/OverSSH|粵語| [[::Installation/OverSSH/zh/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/zh | • {{#if: UbuntuHelp:Installation/OverSSH|中文| [[::Installation/OverSSH/zh/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/zh-hans | • {{#if: UbuntuHelp:Installation/OverSSH|中文(简体)| [[::Installation/OverSSH/zh/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:Installation/OverSSH | UbuntuHelp:Installation/OverSSH | {{#if: | :}}Installation/OverSSH/zh}}/zh-hant | • {{#if: UbuntuHelp:Installation/OverSSH|中文(繁體)| [[::Installation/OverSSH/zh/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:Installation/OverSSH|:Installation/OverSSH/zh|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :Installation/OverSSH/zh/zh | | {{#ifexist: Installation/OverSSH/zh/zh | | {{#ifeq: {{#titleparts:Installation/OverSSH/zh|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Installation/OverSSH/zh|1|-1|}} | zh | | }}
!! 请注意,这是一个正在实验中的项目,它不是很成熟,并且有可能搞坏您的系统。
警告
正如你可能已经猜到的那样,这里介绍的方法有可能导致您的系统不能启动,并且你得依靠自己修复它。 apt-get install linux-image-686
这份指南向您介绍如何通过 ssh 在专用服务器上安装 Ubuntu 。我假设你的供应商为你提供了一个可以引导并准备你的正常作业系统的备用(或者称做恢复 or 急救)系统;这样的话,在线的“系统替换”就成为可能,但是这需要冒很大的风险并有作大量补救工作的准备,以防事情变得更糟糕(the basic idea is to temporarily disable your swap and install a transitional system on it)。
Preparing the Hard Disk
Partitioning
使用 fdisk
在磁盘上创建分区。
# fdisk /dev/hda
切记要把root分区设为活动分区(可以启动的)!在稍後的介绍中,我将假设你使用下面的分区布局,请根据你自己的情况改变。
/dev/hda1 (83 Linux) - for /, /dev/hda2 (82 Linux swap) - as swap
创建文件系统
下面我将使用流行的 ext3 格式格式化我的 / 分区
# mke2fs -j /dev/hda1 or # mkfs.ext3 /dev/hda1
使用以下命令初始化并启用我们的 swap 分区
# mkswap /dev/hda2 # sync; sync; sync # swapon /dev/hda2
基本系统
挂载根分区
# mkdir /mnt/ubuntu # mount -t ext3 /dev/hda1 /mnt/ubuntu
获取 Debootstrap
Debootstrap 是一组在接下来的搭建“基本系统”的步骤中要用到的脚本。 我们需要从http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/ (就近的 mirror 也可以)取得一个合适版本的 debootstrap
。首先确定你的备用系统中安装了 binutils
(包含基本的命令行工具,如wget)工具。 在基于APT的系统上,我们可以使用 dpkg 安装它。
# wget http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/debootstrap_0.3.3.0ubuntu2_all.deb # dpkg -i debootstrap_0.3.3.0ubuntu2_all.deb
如果你现在的系统是基于 RPM 的,使用 alien 工具安装它或者你可以在这个网站上找到它的rpm版本(如:http://azhrarn.underhanded.org/debootstrap-0.2.23-1.i386.rpm)。如果你的系统不属于任何上面的情况,下面的命令可能会有用:
# mkdir /work; cd /work # wget http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/debootstrap_0.3.3.0ubuntu2_all.deb # ar -xf debootstrap-udeb_0.3.3.0ubuntu7_i386.udeb # cd / # tar zxvf work/data.tar.gz
安装基本系统
# /usr/sbin/debootstrap --arch i386 dapper /mnt/ubuntu http://archive.ubuntu.com/ubuntu
(arch may be different for you, e.g. md64, hppa, ia64, powerpc, or sparc)
Basic Configuration
Set the Hostname
Change HOSTNAME to whatever suits your environment.
# echo HOSTNAME > /mnt/ubuntu/etc/hostname
fstab
# vim /mnt/ubuntu/etc/fstab
Put the following in fstab:
# /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0 /dev/hda1 / ext3 defaults,errors=remount-ro 0 1 /dev/hda2 none swap sw 0 0
Networking
Make sure to use your network details instead.
#Network Config: # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 10.0.0.10 network 10.0.0.0 broadcast 10.0.0.255 gateway 10.0.0.1 netmask 255.255.255.0
Make sure to use your hostname and domain.
127.0.0.1 localhost 127.0.0.1 hostname.domain.tld hostname
You need a valid resolv.conf with at least one valid nameserver, e.g.:
nameserver 10.0.0.1
Enter the new environment
Before we chroot into the new environment we need to mount /proc and /dev
mount -t proc none /mnt/ubuntu/proc mount -o bind /dev /mnt/ubuntu/dev LANG= chroot /mnt/ubuntu /bin/bash
Change the root password
It is just bad if you forget this, so just ....
# passwd
Create a user and switch shadow password on
# dpkg-reconfigure --default-priority passwd
Installing Packages
# apt-get update
Installing OpenSSH Server
# apt-get install openssh-server
Install a Kernel
Choose the right kernel for your architecture. I go with:
# apt-get install linux-image-686
Installing GRUB
The boot loader is most important, so do:
apt-get install grub mkdir /boot/grub cp /usr/lib/grub/i386-pc/* /boot/grub vim /boot/grub/grub.conf
# /boot/grub/grub.confdefault 0 timeout 3
title=Ubuntu root (hd0,0) kernel /vmlinuz root=/dev/hda1 initrd /initrd.img
ln -s /boot/grub/grub.conf /boot/grub/menu.lst
# grub
grub> root (hd0,0)grub> setup (hd0) grub> quit
Reboot
# exit # cd /
# umount /mnt/ubuntu/proc
- umount /mnt/ubuntu/dev
- umount /mnt/ubuntu
- reboot
Finishing
After the reboot ssh in again.
Generate locales
# locale-gen en_US.UTF-8 # echo 'LANG="en_US.UTF-8"' >> /etc/environment # echo 'LANGUAGE="en_US:en"' >> /etc/environment
Istall some more packages
apt-get install ubuntu-standard
References
- Installation/FromKnoppix
- The Gentoo Handbook contains a very good (Gentoo specific) instruction on chrooted installation procedures.
- An other instruction from the Ubuntu Installation Guide is somewhat outdated and has shortcomings related to the bootloader installation.
- HOWTO - Install Debian Onto a Remote Linux System - A Debian specific HOWTO.