Ubuntu6.06HowTo
Ubuntu 6.06 (Dapper Drake) 指南 来源: http://www.cs.cornell.edu/%7Edjm/ubuntu/ 我也是一个 Ubuntu (Linux水平也一般) 新手. 使用 Ubuntu 因为比较好玩,兴趣和刺激. 为了当我下一次安装 Ubuntu 是方便,在本页记下了所有的步骤. 我希望也能帮助其它人.
June 2, 2006: 我今天升级到了 Dapper Drake 并修改了本页的部分内容. 我将不再更新 Breezy Badger page .
安装 Ubuntu
下面是本节的屏幕抓图 OSDir's screenshot gallery.
- 下载 Dapper Drake 安装 CD/DVD 映像文件, 然后 刻录映像文件 到 CD/DVD.
- 从 CD/DVD 启动. 这通常可以简单从 CD/DVD 启动电脑. 有些电脑你可能需要在启动的一段时间内按下 F12 (或 F2, 或 DEL, 或 其它什么的) 然后从菜单选择从 CD 启动.
- 选择 启动或安装 Ubuntu 条件.
- 当电脑 从 Live CD 启动 这个版本的 Ubuntu 后, 双击 安装图标.
- 选择 语言; 地区和时区; 键盘; 和 用户名, 密码, 和电脑名.
目的 | 尺寸 | 文件系统 |
swap 交换空间 | 1 - 2GB | linux-swap |
root 目录 (/ ) |
4 - 8GB | reiserfs (或 ext3) |
home 目录 (/home ) |
剩余空间 | reiserfs (或 ext3) |
- 检查你的选择, 然后点击 "Install".
- 阅读一些杂志或者干些别的事情 当 Ubuntu 安装时.
- 当安装完成后,会得到一个提示, 点击 "Reboot the computer" 按钮. 确信取出了 CD/DVD 这样电脑不会重新从 Live CD 启动.
- 如果 Ubuntu 在其它的分区上检测到了 Windows , 将提示你 使用 GRUB 多重启动. 最上面的选项是 Ubuntu. 选择它, 或者仅仅等到计时器到0.
- 但电脑 重启 到第一次安装的 Ubuntu, 使用你早前安装时设置的用户名和密码登录 .
- 祝贺! 你现在已经开始 运行 Ubuntu! 为什么这么容易? :)
初步设置
更新和升级包
sudo apt-get update sudo apt-get upgrade
安装 nVidia 显卡驱动
安装 nVidia 显卡驱动会自动修复某些屏幕分辨率的问题.
sudo apt-get install nvidia-glx
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup.nvidia sudo nvidia-glx-config enable
sudo gedit /etc/X11/xorg.conf
Section "Device" ... Driver "nv" ... EndSection
Section "Device" ... Driver "nvidia" ... EndSection
sudo gedit /usr/share/applications/nvidia-settings.desktop
[Desktop Entry] Name=NVIDIA Settings Comment=nVidia Settings Exec=nvidia-settings Icon= Terminal=false Type=Application Categories=Application;System;
sudo gedit /etc/X11/xorg.conf
Section "Device" Identifier "NVIDIA Corporation ..." ... EndSection
Section "Device" Identifier "NVIDIA Corporation ..." ... Option "NoLogo" EndSection
- (可选) 重启 Gnome Desktop Manager 让配置生效.
这里是自动执行1-4步的脚本:
sudo apt-get install nvidia-glx sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup.nvidia sudo nvidia-glx-config enable sudo sed -i -e's@Driver[ \t]\{1,\}"nv"@Driver\t\t"nvidia"\n\tOption\t\t"NoLogo"@g' /etc/X11/xorg.conf (printf '[Desktop Entry]\nName=NVIDIA Settings\nComment=nVidia Settings\nExec=nvidia-settings\nIcon=\nTerminal=false\nType=Application\nCategories=Application;System;\n') | sudo tee /usr/share/applications/nvidia-settings.desktop
激活 5-button 鼠标
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup.mouse sudo gedit /etc/X11/xorg.conf
Section "InputDevice" Identifier "Configured Mouse" Driver "mouse" ... Option "Protocol" "ExplorerPS/2" ... Option "Emulate3Buttons" "true" ... EndSection
Section "InputDevice" Identifier "Configured Mouse" Driver "mouse" ... Option "Protocol" "ExplorerPS/2" ... Option "Emulate3Buttons" "false" Option "Buttons" "7" Option "ButtonMapping" "1 2 3 6 7" ... EndSection
- (可选) 重启 Gnome Desktop Manager 让配置生效.
这里是自动执行1步的脚本:
sudo sed -i.backup.mouse -e's@[ \t]*Option[ \t]\{1,\}"Emulate3Buttons"[ \t]\{1,\}"true"@\tOption\t\t"Emulate3Buttons"\t"false"\n\tOption\t\t"Buttons"\t\t"7"\n\tOption\t\t"ButtonMapping"\t\t"1 2 3 6 7"@g' /etc/X11/xorg.conf
激活 CD/DVD 弹出
sudo sysctl dev.cdrom.lock=0
sudo cp /etc/sysctl.conf /etc/sysctl.conf.backup.eject sudo gedit /etc/sysctl.conf
dev.cdrom.lock=0
这里是自动执行1步的脚本:
if ! cat /etc/sysctl.conf | grep "dev.cdrom.lock=0"; then sudo cp /etc/sysctl.conf /etc/sysctl.conf.backup.eject; >> /etc/sysctl.conf'; fi;
增加扩展库
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
sudo gedit /etc/apt/sources.list
deb http://us.archive.ubuntu.com/ubuntu dapper main restricted deb-src http://us.archive.ubuntu.com/ubuntu dapper main restricted deb http://security.ubuntu.com/ubuntu dapper-security main restricted deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted deb http://us.archive.ubuntu.com/ubuntu dapper-updates main restricted deb-src http://us.archive.ubuntu.com/ubuntu dapper-updates main restricted deb http://us.archive.ubuntu.com/ubuntu dapper universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu dapper universe multiverse deb http://security.ubuntu.com/ubuntu dapper-security universe multiverse deb-src http://security.ubuntu.com/ubuntu dapper-security universe multiverse deb http://us.archive.ubuntu.com/ubuntu dapper-updates universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu dapper-updates universe multiverse deb http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse deb-src http://archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse #deb http://packages.freecontrib.org/ubuntu/plf/ dapper free non-free #deb-src http://packages.freecontrib.org/ubuntu/plf/ dapper free non-free #deb ftp://ftp.free.fr/pub/Distributions_Linux/plf/ubuntu/plf/ dapper free non-free #deb-src ftp://ftp.free.fr/pub/Distributions_Linux/plf/ubuntu/plf/ dapper free non-free
sudo apt-get update
这里是自动执行1-3步的脚本(需要Internet访问):
wget -c -o /tmp/sources.list http://www.cs.cornell.edu/~djm/ubuntu/sources.list sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup sudo cp /tmp/sources.list /etc/apt/sources.list sudo apt-get update
常用的包
安装 Microsoft 字体
sudo apt-get install msttcorefonts
安装多媒体解码驱动和播放器
wget -c -o /tmp/w32codecs.deb ftp://ftp.free.fr/pub/Distributions_Linux/plf/ubuntu/plf/pool/dapper/i386/non-free/w32codecs/w32codecs_20050412-1plf4_i386.deb wget -c -o /tmp/libdvdcss2.deb ftp://ftp.free.fr/pub/Distributions_Linux/plf/ubuntu/plf/pool/dapper/i386/free/libdvdcss2/libdvdcss2_1.2.9-1plf3_i386.deb sudo dpkg -i /tmp/w32codecs.deb /tmp/libdvdcss2.deb
wget -c -o /tmp/w32codecs.deb ftp://ftp.nerim.net/debian-marillat/pool/main/w/w32codecs/w32codecs_20050412-0.4_i386.deb sudo dpkg -i /tmp/w32codecs.deb sudo apt-get install libdvdread3 sudo /usr/share/doc/libdvdread3/examples/install-css.sh
sudo apt-get install lame sox ffmpeg mjpegtools mpg321 vorbis-tools
sudo apt-get install totem-xine libxine-extracodecs
sudo apt-get install totem-gstreamer gstreamer0.10-plugins-good gstreamer0.10-plugins-bad gstreamer0.10-plugins-ugly gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly-multiverse gstreamer0.10-gl gstreamer0.10-ffmpeg
(printf '#!/bin/bash\ntotem --enqueue $NAUTILUS_SCRIPT_SELECTED_URIS\n') > ~/.gnome2/nautilus-scripts/totem-enqueue (printf '#!/bin/bash\ntotem --replace $NAUTILUS_SCRIPT_SELECTED_URIS\n') > ~/.gnome2/nautilus-scripts/totem-replace chmod +x ~/.gnome2/nautilus-scripts/totem-enqueue ~/.gnome2/nautilus-scripts/totem-replace
sudo apt-get install mplayer sudo sed -i.backup -e's@vo=x11,@vo=xv,@g' /etc/mplayer/mplayer.conf
sudo apt-get install mozilla-mplayer
安装 TiMidity (MIDI 播放器)
sudo apt-get install timidity timidity-interfaces-extra
sudo gedit /usr/share/applications/timidity.desktop
[Desktop Entry] Encoding=UTF-8 Name=Timidity MIDI Player Comment=Play MIDI audio files Exec=timidity -ig Terminal=false Type=Application StartupNotify=false MimeType=audio/midi; Categories=Application;AudioVideo; Icon= #NoDisplay=true
sudo cp /usr/share/applications/defaults.list /usr/share/applications/defaults.list.backup.midi sudo gedit /usr/share/applications/defaults.list
audio/midi=timidity.desktop
wget -c -o /tmp/timidity-patches-eaw http://www.fbriere.net/debian/dists/etch/misc/deb/timidity-patches-eaw_12-0fbriere.1_all.deb sudo dpkg -i /tmp/timidity-patches-eaw.deb sudo gedit /etc/timidity/timidity.cfg
source /etc/timidity/freepats.cfg
source /usr/share/doc/timidity-patches-eaw/examples/timidity.cfg
sudo gedit /etc/timidity/timidity.cfg
opt EFresamp=d #disable resampling (or "opt EFresamp=l" for linear resampling) opt EFvlpf=d #disable VLPF opt EFreverb=d #disable reverb opt EFchorus=d #disable chorus opt EFdelay=d #disable delay
这里是自动执行1-4步的脚本:
sudo apt-get install timidity timidity-interfaces-extra (printf '[Desktop Entry]\nEncoding=UTF-8\nName=Timidity MIDI Player\nComment=Play MIDI audio files\nExec=timidity -ig\nTerminal=false\nType=Application\nStartupNotify=false\nMimeType=audio/midi;\nCategories=Application;AudioVideo;\n#Icon=???\n#NoDisplay=true\n') | sudo tee /usr/share/applications/timidity.desktop sudo cp /usr/share/applications/defaults.list /usr/share/applications/defaults.list.backup.midi if ! cat /usr/share/applications/defaults.list | grep "audio/midi"; then (printf 'audio/midi=timidity.desktop\n') | sudo tee -a /usr/share/applications/defaults.list; else sudo sed -i -e's@audio/midi.*$@audio/midi=timidity.desktop@g' /usr/share/applications/defaults.list; fi; wget -c -o /tmp/timidity-patches-eaw http://www.fbriere.net/debian/dists/etch/misc/deb/timidity-patches-eaw_12-0fbriere.1_all.deb sudo dpkg -i /tmp/timidity-patches-eaw.deb sudo sed -i.backup -e's@source /etc/timidity/freepats.cfg@source /usr/share/doc/timidity-patches-eaw/examples/timidity.cfg@g' /etc/timidity/timidity.cfg
安装 GParted (磁盘分区工具)
sudo apt-get install gparted
安装 Mozilla Thunderbird (email 客户端)
sudo apt-get install mozilla-thunderbird
- (optional) See how to restore Mozilla Firefox and Thunderbird icons.
安装 GnomeBaker (CD 刻录)
sudo apt-get install gnomebaker
安装 Sound Juicer (audio CD 抓轨)
sudo apt-get install sound-juicer
安装 Acroread (PDF 阅读器)
sudo apt-get install acroread
sudo sed -i.backup.acroread -e's@application/pdf=evince.desktop@application/pdf=AdobeReader.desktop@g' /usr/share/applications/defaults.list
sudo apt-get install mozilla-acroread
为 Firefox 安装 Flash 插件
sudo apt-get install flashplugin-nonfree sudo update-flashplugin
安装 Sun Java
(See the Restricted Formats page.)
sudo apt-get install sun-java5-jre sun-java5-plugin sudo update-alternatives --config java
安装 teTeX (LaTeX)
sudo apt-get install tetex-base tetex-bin tetex-extra
- Here is a sample LaTeX file and the Makefile to compile it with.
安装 Octave (Matlab 代替)
sudo apt-get install octave
安装 Gnuplot (绘制/图形 工具)
sudo apt-get install gnuplot
安装 开发工具
sudo apt-get install build-essential manpages-dev
sudo apt-get install libgmp3-dev libgmp3-doc
sudo apt-get install libxxf86vm-dev nvidia-glx-dev ftgl-dev sudo apt-get install libsdl1.2-dev libsdl-ttf2.0-dev libsdl-image1.2-dev libsdl-mixer1.2-dev sudo apt-get install libsdl-sound1.2-dev libsdl-net1.2-dev
sudo ln -s /usr/include/freetype2/freetype /usr/include/freetype
安装 CVS (版本控制系统)
sudo apt-get install cvs
sudo apt-get install tkcvs
安装 GVim (编辑器)
sudo apt-get install vim-gnome
- (optional) Tinker with your
~/.vimrc
file to your heart's content. (See my ~/.vimrc for an example.)
sudo sed -i.backup.gvim -e'[email protected]@gvim.desktop@g' -e's@text/x-csrc=gvim.desktop@text/x-csrc=gvim.desktop\ntext/x-c++hdr=gvim.desktop\ntext/x-c++src=gvim.desktop\ntext/x-csharp=gvim.desktop\ntext/x-tex=gvim.desktop@g' /usr/share/applications/defaults.list sudo sed -i.backup -e's@MimeType=text/plain;@MimeType=text/plain;text/html;text/css;text/xml;text/x-dtd;text/x-chdr;text/x-csrc;text/x-c++hdr;text/x-c++src;text/x-java;text/x-csharp;text/x-tex;text/x-bibtex;text/x-readme;@g' -e's@NoDisplay=true@NoDisplay=false@g' /usr/share/applications/gvim.desktop
安装 jEdit (编辑器)
sudo gedit /etc/apt/sources.list
deb http://dl.sourceforge.net/sourceforge/jedit ./ deb-src http://dl.sourceforge.net/sourceforge/jedit ./
sudo apt-get update sudo apt-get install jedit
sudo gedit /usr/bin/jedit
... ${JEDIT} -jar "/usr/share/jedit/jedit.jar" $@
... ${JEDIT} -jar "/usr/share/jedit/jedit.jar" -reuseview $@
安装 游戏 (ScummVM)
sudo apt-get install supertux scummvm sudo apt-get install beneath-a-steel-sky flight-of-the-amazon-queen
安装 OpenSSH (SSH 服务)
sudo apt-get install openssh-server
- You might also need to send your host-name to your DHCP server.
排除故障
修复声音
参考 http://ubuntuguide.org/#configuresoundproperly.
修复屏幕分辨率
参考 https://wiki.ubuntu.com/FixVideoResolutionHowto 更多信息. 下面是我的配置:
sudo ddcprobe | grep monitorrange
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup.sync_and_refresh sudo gedit /etc/X11/xorg.conf
Section "Monitor" ... HorizSync 30-96 VertRefresh 50-160 EndSection
修复 Xine's WMV 播放
cp ~/.xine/catalog.cache ~/.xine/catalog.cache.backup gedit ~/.xine/catalog.cache
[/usr/lib/xine/plugins/1.0.0/xineplug_decode_w32dll.so] size=173768 mtime=1112804124 type=131 api=15 id=win32a version=10000 supported_types=50593792 52428800 52822016 ... (long line truncated) decoder_priority=1
decoder_priority=1
decoder_priority=7
修复 jumpy/skipping/choppy/stuttering CD/DVD 播放
参考 http://ubuntuguide.org/#speedupcddvdrom.
sudo hdparm -d /dev/[device]
sudo hdparm -d1 /dev/[device] sudo cp /etc/hdparm.conf /etc/hdparm.conf.backup.dma sudo gedit /etc/hdparm.conf
/dev/[device] { dma === on }
修复 "There are differences between boot sector and its backup" 错误
sudo gedit /etc/fstab
/dev/hda1 /media/hda1 vfat defaults,utf8,umask=007,gid=46 0 1
/dev/hda1 /media/hda1 vfat iocharset=utf8,umask=000 0 0
定制
电脑改名
gksudo network-admin
- (可选) 如果你远程访问你的电脑, 你可能需要 tell your DHCP server your host-name.
自定义风格和字体
gnome-theme-manager
gnome-font-properties
重新定义 /home 目录
重要:这个仅仅适用于你移动你的 home 目录到其它驱动器,或者激活其它驱动器上存在的 home 目录.
sudo mkdir /media/new
sudo mount -t ext3 /dev/hdb1 /mnt/new/
sudo mount -t reiserfs -o notail /dev/hdb1 /mnt/new/
sudo cp -R -p /home/[user] /mnt/new/ sudo chown [user]:[user] /mnt/new/[user] sudo umount /mnt/new/
sudo nano /etc/fstab
/dev/hdb1 /home ext3 defaults,errors=remount-ro 0 2
/dev/hdb1 /home reiserfs defaults,notail 0 2
屏蔽 USplash
sudo cp /boot/grub/menu.lst /boot/grub/menu.lst.backup sudo gedit /boot/grub/menu.lst
kernel /boot/... root=... ro quiet splash
kernel /boot/... root=... ro quiet
激活 在启动时的绿色 [ok] 信息
sudo cp /lib/lsb/init-functions /lib/lsb/init-functions.backup sudo gedit /lib/lsb/init-functions
log_success_msg () { echo "$@" }
log_success_msg () { if log_use_fancy_output; then GREEN=`$TPUT setaf 2` NORMAL=`$TPUT op` echo "$GREEN*$NORMAL $@" else echo "$@" fi }
重置 Mozilla Firefox 和 Thunderbird 图标
wget -c http://www.cs.cornell.edu/~djm/ubuntu/mozilla-icons/mozilla-firefox.png wget -c http://www.cs.cornell.edu/~djm/ubuntu/mozilla-icons/document.png chmod 644 mozilla-firefox.png document.png sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-firefox.png sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-firefox.xpm sudo dpkg-divert --rename /usr/lib/mozilla-firefox/icons/default.xpm sudo dpkg-divert --rename /usr/lib/mozilla-firefox/icons/document.png sudo dpkg-divert --rename /usr/lib/mozilla-firefox/chrome/icons/default/default.xpm sudo cp mozilla-firefox.png /usr/share/pixmaps/mozilla-firefox.png sudo cp mozilla-firefox.png /usr/share/pixmaps/mozilla-firefox.xpm sudo cp mozilla-firefox.png /usr/lib/mozilla-firefox/icons/default.xpm sudo cp document.png /usr/lib/mozilla-firefox/icons/document.png sudo cp mozilla-firefox.png /usr/lib/mozilla-firefox/chrome/icons/default/default.xpm
wget -c http://www.cs.cornell.edu/~djm/ubuntu/mozilla-icons/mozilla-thunderbird.xpm chmod 644 mozilla-thunderbird.xpm sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird.xpm sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird-menu.xpm sudo dpkg-divert --rename /usr/share/pixmaps/mozilla-thunderbird-pm-menu.xpm sudo dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/mozilla-thunderbird.xpm sudo dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow16.xpm sudo dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow.xpm sudo dpkg-divert --rename /usr/lib/mozilla-thunderbird/chrome/icons/default/default.xpm sudo cp mozilla-thunderbird.xpm /usr/share/pixmaps/mozilla-thunderbird.xpm sudo cp mozilla-thunderbird.xpm /usr/share/pixmaps/mozilla-thunderbird-menu.xpm sudo cp mozilla-thunderbird.xpm /usr/share/pixmaps/mozilla-thunderbird-pm-menu.xpm sudo cp mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/mozilla-thunderbird.xpm sudo cp mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow16.xpm sudo cp mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/messengerWindow.xpm sudo cp mozilla-thunderbird.xpm /usr/lib/mozilla-thunderbird/chrome/icons/default/default.xpm
硬件
Mount
sudo mount /dev/hdb1 [mount_point_dir] -t reiserfs -o notail
sudo mount /dev/hdb1 [mount_point_dir] -t ext3
sudo mount /dev/hda1 [mount_point_dir] -t ntfs -o nls=utf8,umask=0222
sudo mount /dev/hda1 [mount_point_dir] -t vfat -o iocharset=utf8,umask=000
sudo mount /media/cdrom0/ -o unhide
sudo modprobe loop sudo mount file.iso /media/iso/ -t iso9660 -o loop -r
Unmount
sudo umount [mount_point_dir]
sudo umount -l [mount_point_dir]
建立 ISO
sudo umount -l /dev/dvd sudo mount /dev/dvd
dd if=/dev/[device] of=file.iso bs=1024
mkisofs -o file.iso [dir]
MD5 校验
md5sum file.iso > file.iso.md5
md5sum -c file.iso.md5
增加或者修改缺省的程序
Quick explanation: In order to associate an application (e.g., gThumb Image Viewer), with a file-type (e.g., PNG image files), the application needs to have a "desktop entry" (e.g., gthump.desktop
) located in the /usr/share/applications/
directory. Furthermore, the file-type needs to have a mime-type located in the /usr/share/mime/
directory or one of its sub-directories (e.g., /usr/share/mime/images/png.xml
). Finally, there should be a line in the /usr/share/applications/defaults.list
file that associates the desktop entry with the mime-type (e.g., images/png=gthumb.desktop
).
sudo cp /usr/share/applications/defaults.list /usr/share/applications/defaults.list.backup
sudo gedit /usr/share/applications/defaults.list
[mime-type]=[new-app].desktop
ls /usr/share/applications/*.desktop
ls /usr/share/applications/mime/[text|image|...]
killall gnome-panel killall nautilus
删除 occurences of ^M in Vim
:%s/^M$//g
:%s/^M/ /g
SSH/Remote access
设置 SSH tunneling
See the CFS connectivity page and this example ~/.ssh/config file for information specific to CUCS tunneling.
nano ~/.ssh/config
host [bastion_hostname] user [bastion_username] hostname [bastion_hostname].[bastion_domain] ForwardAgent yes LocalForward 2001 [target_hostname].[target_domain]:22 host [target_hostname] user [target_username] hostname localhost port 2001
ssh -f -N [bastion_hostname]
ssh [target_hostname]
- (optional) Set up public key authentication.
设置 SSH public key authentication
ssh-keygen -f [key_file] -t dsa
- Append the contents of your
[key_file].pub
to the server's~/.ssh/authorized_keys2
file. If you don't have access, email the server's admin.
ssh -i [key_file] [server_name].[server_domain]
cp ~/.ssh/known_hosts ~/.ssh/known_hosts.backup ssh -N -f [bastion_hostname] ssh-keyscan -H -t rsa,dsa -p 2001 localhost >> ~/.ssh/known_hosts ssh-keyscan -H -t rsa,dsa -p 2002 localhost >> ~/.ssh/known_hosts ssh-keyscan -H -t rsa,dsa -p ... localhost >> ~/.ssh/known_hosts
- (optional) Set up SSH key management so that you only have to enter your passphrase once per session.
SSH key management
The following allows you to set things up so that you only have to enter your SSH key passphrase once per login session.
sudo apt-get install gnome-keyring-manager
ssh-add
ssh-add -D
Reboot (remotely) from Ubuntu into Windows
NOTE: this assumes that you use GRUB to dual boot and that you do NOT use dmraid.
- If you are rebooting a remote computer, first SSH into the remote computer, and then follow the next steps in the remote terminal.
sudo nano /boot/grub/menu.lst
default 0
default saved
sudo grub-reboot [number]
Reboot (remotely) from Windows into Ubuntu
NOTE: this assumes that you use GRUB to dual boot, and that Ubuntu is the first boot option in /root/grub/menu.lst
.
- If you are rebooting a remote computer, first Remote-desktop into the remote computer, and then follow the next step in the remote desktop.
shutdown /r /t 00
Remote desktop to your CUCS computer that is currently running Windows
NOTE: The remote computer must be currently booted in WinXP, so you might have to reboot remotely from Ubuntu to Windows first.
- Configure SSH tunneling for CUCS using the example ~/.ssh/config file. The following assumes that in SSH forwards
localhost:2011
to[CUCS_hostname].u.cs.cornell.edu:3389
on lion (as per your~/.ssh/config
file).
ssh -N -f herakles ssh -N -f lion
rdesktop -r disk:sync=/home/[local_dir] localhost:2011
Access your CUCS home directories via Samba
NOTE: I find that using SFTP is faster and more reliable.
See http://www.cs.cornell.edu/support/Linux/smbmount.htm for additional info.
- Configure SSH tunneling for CUCS using the example ~/.ssh/config file. The following assumes that in SSH forwards
localhost:2017
tosmb.cs.cornell.edu:139
on lion (as per your~/.ssh/config
file).
ssh -N -f herakles ssh -N -f lion
smbclient //smb.cs.cornell.edu/win -U [username] -W CUCS -I localhost -p 2017
smbmount //smb.cs.cornell.edu/win [local_dir] -o ip=localhost,port=2017,username=[username],workgroup=CUCS
smbumount [local_dir]
Access your CUCS home directories via SFTP
I find this method faster and more reliable than using Samba.
- Configure SSH tunneling for CUCS using the example ~/.ssh/config file.
ssh -N -f herakles sftp lion
sftp://lion/home/[user]
sftp://lion/home/WIN/[user]
sftp://lion/home/BIGBOX/[user]
sftp://lion/home/BIGBOX.win/[user]
\\cucs\home\UNIX\[user]
\\cucs\home\Windows\[user]
\\cs.cornell.edu\home\bigbox\[user]
Send host-name to DHCP server
If you have trouble accessing your Ubuntu machine remotely, it might be because the DHCP server needs to be informed of the machine's name.
sudo cp /etc/dhcp3/dhclient.conf /etc/dhcp3/dhclient.conf.backup sudo gedit /etc/dhcp3/dhclient.conf
send "[hostname].[domain]";
- Reboot the computer.
Restart the Gnome Desktop Manager (GDM)
- Close all open programs.
sudo /etc/init.d/gdm restart
Recursively remove files by name
find [dir] -name "*.monkeypoop" -ok rm {} \;
Links
Most of the information on this page comes from the following sources:
- The Ubuntu Dapper Drake 6.06 Guide
- The Official Ubuntu Start Guide
- The Ubuntu Restricted Formats Wiki
- The Ubuntu Forums
You can visit my home page to find out how to contact me with feedback and suggestions for this site.