Ubuntu server 12.04
From Attie's Wiki
(Difference between revisions)
m |
m (→Packages) |
||
(35 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
+ | [[ubuntu_server_12.04/exFAT|Setup exFAT]]<br> | ||
+ | [[ubuntu_server_12.04/nodejs|Setup node.js]]<br> | ||
+ | [[Network/interfaces|Setup network interfaces]] | ||
+ | |||
== Packages == | == Packages == | ||
As root, install the following (all are optional of course)... | As root, install the following (all are optional of course)... | ||
Line 11: | Line 15: | ||
apt-get install xterm x11-xserver-utils | apt-get install xterm x11-xserver-utils | ||
− | # install | + | # install SSH |
apt-get install openssh-server | apt-get install openssh-server | ||
− | + | # configure SSH | |
− | + | ||
− | # | + | |
sed -re 's/^#?( *GSSAPIAuthentication ).*$/\1 no/' -i /etc/ssh/ssh_config -i /etc/ssh/sshd_config | sed -re 's/^#?( *GSSAPIAuthentication ).*$/\1 no/' -i /etc/ssh/ssh_config -i /etc/ssh/sshd_config | ||
+ | sed -re 's/^#?( *UsePAM ).*$/\1 yes/' -i /etc/ssh/ssh_config -i /etc/ssh/sshd_config | ||
+ | echo "auth required pam_listfile.so item=group sense=allow file=/etc/ssh/sshd.group.allow onerr=fail" >> /etc/pam.d/sshd | ||
+ | addgroup --system ssh-pwaccess | ||
+ | echo "ssh-pwaccess" >> /etc/ssh/sshd.group.allow | ||
+ | |||
+ | # install samba | ||
+ | apt-get install samba-common samba-common-bin | ||
+ | smbpasswd attie | ||
# install libraries | # install libraries | ||
Line 24: | Line 34: | ||
apt-get install manpages-posix manpages-posix-dev | apt-get install manpages-posix manpages-posix-dev | ||
− | # c++ toolchain | + | # c++ toolchain and libraries |
− | apt-get install g++ g++-multilib | + | apt-get install g++ g++-multilib libreadline6-dev |
− | # install ctags & vim | + | # install ctags, cscope & vim |
− | apt-get install ctags vim | + | apt-get install ctags cscope vim |
# install 32-bit libs and headers (if on a 64-bit host) | # install 32-bit libs and headers (if on a 64-bit host) | ||
Line 34: | Line 44: | ||
# install tools | # install tools | ||
− | apt-get install apt-file subversion git tree minicom shed valgrind lzop screen uboot-mkimage ethtool htop | + | apt-get install apt-file python-software-properties |
+ | apt-get install subversion git mercurial bzr tree minicom shed valgrind lzop screen uboot-mkimage ethtool htop p7zip-full | ||
# install dos2unix & unix2dos | # install dos2unix & unix2dos | ||
Line 59: | Line 70: | ||
# turn off the infuriating MOTD | # turn off the infuriating MOTD | ||
− | + | sed -re 's/^([^#].*pam_motd.so)/#\1/' -i /etc/pam.d/login -i /etc/pam.d/sshd | |
+ | |||
+ | # remove landscape | ||
+ | apt-get remove --purge landscape-common | ||
# install kernel headers | # install kernel headers | ||
apt-get install linux-headers-$(uname -r) | apt-get install linux-headers-$(uname -r) | ||
− | # install the java runtime environment | + | # install the java runtime environment and optional dev tools |
− | apt-get install openjdk-7-jre | + | apt-get install openjdk-7-jre openjdk-7-jdk |
+ | |||
+ | # turn off that stupid auto completion for 'mount' | ||
+ | chmod 000 /etc/bash_completion.d/mount | ||
</source> | </source> | ||
Line 74: | Line 91: | ||
== Services == | == Services == | ||
+ | === Management === | ||
+ | <source lang="bash"> | ||
+ | apt-get install sysv-rc-conf | ||
+ | </source> | ||
+ | |||
+ | === Reccomended === | ||
The marks are for recommended installations, you don't have to listen to them ;) | The marks are for recommended installations, you don't have to listen to them ;) | ||
{| | {| | ||
Line 103: | Line 126: | ||
|- | |- | ||
| X || - || [[ubuntu_server_12.04/mail_archive|Mail Archiver]] | | X || - || [[ubuntu_server_12.04/mail_archive|Mail Archiver]] | ||
+ | |- | ||
+ | | X || - || [[Gmvault|GMail Backup]] | ||
|} | |} | ||
== Other == | == Other == | ||
* [[Passwd|/etc/passwd and relations]] | * [[Passwd|/etc/passwd and relations]] | ||
+ | * [[bashrc]] | ||
+ | * [[Xresources]] | ||
+ | * [[Git#.gitconfig|gitconfig]] | ||
+ | * [[Gpg]] | ||
+ | * [[htoprc]] | ||
+ | * [[vimrc]] | ||
+ | * [[hgrc]] | ||
+ | * [[sshconfig]] | ||
+ | * [[Ubuntu_arm_toolchain|ARM Toolchain]] | ||
+ | * [[Ubuntu_avr_toolchain|AVR Toolchain]] | ||
+ | * [[mercurial-server]] | ||
+ | * [[gitolite]] | ||
+ | * [[mediawiki]] | ||
+ | * [[google-authenticator]] | ||
== User Setup == | == User Setup == | ||
Line 118: | Line 157: | ||
</source> | </source> | ||
− | + | == Proxy Setup == | |
+ | <source lang="bash"> | ||
+ | cat >/etc/profile.d/proxy.sh <<"EOF" | ||
+ | export http_proxy=http://10.1.1.1:8080/ | ||
+ | export https_proxy=$http_proxy | ||
+ | export ftp_proxy=$http_proxy | ||
+ | EOF | ||
+ | |||
+ | cat >>/etc/sudoers <<EOF | ||
+ | Defaults env_keep="http_proxy https_proxy ftp_proxy" | ||
+ | EOF | ||
+ | </source> | ||
+ | |||
+ | == Set the Hostname == | ||
+ | <source lang="bash"> | ||
+ | OLD_HOSTNAME=$(hostname) | ||
+ | echo "${NEW_HOSTNAME}" > /etc/hostname | ||
+ | hostname "${NEW_HOSTNAME}" | ||
+ | sed -re "s/${OLD_HOSTNAME}/${NEW_HOSTNAME}/g" -i /etc/hosts | ||
+ | </source> | ||
+ | |||
+ | == SSH Won't Connect? == | ||
+ | <source lang="bash"> | ||
+ | rm /etc/ssh/ssh_host_* | ||
+ | dpkg-reconfigure openssh-server | ||
+ | /etc/init.d/ssh restart | ||
+ | </source> | ||
+ | |||
+ | == Set the Time Zone == | ||
+ | <source lang="bash"> | ||
+ | dpkg-reconfigure tzdata | ||
+ | </source> | ||
+ | |||
+ | == Set the Time According to time.nist.gov == | ||
+ | <source lang="bash"> | ||
+ | service ntp stop | ||
+ | ntpdate -s time.nist.gov | ||
+ | service ntp start | ||
+ | </source> | ||
+ | |||
+ | == Using the Hardware Clock == | ||
+ | ==== Display RTC's Time ==== | ||
+ | <source lang="bash"> | ||
+ | hwclock -r | ||
+ | </source> | ||
+ | |||
+ | ==== Set the System Time to that of the RTC ==== | ||
+ | <source lang="bash"> | ||
+ | hwclock -s | ||
+ | </source> | ||
+ | |||
+ | ==== Set the RTC's time to that of the System ==== | ||
+ | <source lang="bash"> | ||
+ | hwclock -w | ||
+ | </source> |
Latest revision as of 11:09, 12 June 2015
Setup exFAT
Setup node.js
Setup network interfaces
Contents |
[edit] Packages
As root, install the following (all are optional of course)...
# sort out 'sudo' (don't do this on a production server!) echo "attie ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers # use bash you idiot dpkg-reconfigure -plow dash # Xterm (always useful with Xming) apt-get install xterm x11-xserver-utils # install SSH apt-get install openssh-server # configure SSH sed -re 's/^#?( *GSSAPIAuthentication ).*$/\1 no/' -i /etc/ssh/ssh_config -i /etc/ssh/sshd_config sed -re 's/^#?( *UsePAM ).*$/\1 yes/' -i /etc/ssh/ssh_config -i /etc/ssh/sshd_config echo "auth required pam_listfile.so item=group sense=allow file=/etc/ssh/sshd.group.allow onerr=fail" >> /etc/pam.d/sshd addgroup --system ssh-pwaccess echo "ssh-pwaccess" >> /etc/ssh/sshd.group.allow # install samba apt-get install samba-common samba-common-bin smbpasswd attie # install libraries apt-get install libncurses5-dev # install man pages apt-get install manpages-posix manpages-posix-dev # c++ toolchain and libraries apt-get install g++ g++-multilib libreadline6-dev # install ctags, cscope & vim apt-get install ctags cscope vim # install 32-bit libs and headers (if on a 64-bit host) apt-get install ia32-libs libc6-dev-i386 # install tools apt-get install apt-file python-software-properties apt-get install subversion git mercurial bzr tree minicom shed valgrind lzop screen uboot-mkimage ethtool htop p7zip-full # install dos2unix & unix2dos apt-get install tofrodos ln -s /usr/bin/fromdos /usr/bin/dos2unix ln -s /usr/bin/todos /usr/bin/unix2dos # install nfs apt-get install nfs-common # remove AppArmor /etc/init.d/apparmor stop update-rc.d -f apparmor remove apt-get remove apparmor apparmor-utils # install NTP apt-get install ntp ntpdate # sort out the 'ohh.. did you mean this?' dpkg -r command-not-found command-not-found-data # if you have just copied a 'fresh' VM, you'll want to clean out the udev network rules nano /etc/udev/rules.d/70-persistent-net.rules # turn off the infuriating MOTD sed -re 's/^([^#].*pam_motd.so)/#\1/' -i /etc/pam.d/login -i /etc/pam.d/sshd # remove landscape apt-get remove --purge landscape-common # install kernel headers apt-get install linux-headers-$(uname -r) # install the java runtime environment and optional dev tools apt-get install openjdk-7-jre openjdk-7-jdk # turn off that stupid auto completion for 'mount' chmod 000 /etc/bash_completion.d/mount
Tidy up with:
apt-get autoremove
[edit] Services
[edit] Management
apt-get install sysv-rc-conf
[edit] Reccomended
The marks are for recommended installations, you don't have to listen to them ;)
Server | Development | Package |
---|---|---|
X | - | RPC bind |
X | X | Samba |
X | - | Apache |
X | - | * GitWeb |
X | - | MySQL |
X | - | DNS |
X | - | DHCP |
X | - | FTP |
X | - | NFS |
X | - | TFTP |
X | - | DynDNS Client |
X | - | APCupsd |
X | - | Mail Archiver |
X | - | GMail Backup |
[edit] Other
- /etc/passwd and relations
- bashrc
- Xresources
- gitconfig
- Gpg
- htoprc
- vimrc
- hgrc
- sshconfig
- ARM Toolchain
- AVR Toolchain
- mercurial-server
- gitolite
- mediawiki
- google-authenticator
[edit] User Setup
Run the following as your user, e.g: attie
# generate an SSH keypair ssh-keygen # make a 'Downloads' directory mkdir ~/Downloads
[edit] Proxy Setup
cat >/etc/profile.d/proxy.sh <<"EOF" export http_proxy=http://10.1.1.1:8080/ export https_proxy=$http_proxy export ftp_proxy=$http_proxy EOF cat >>/etc/sudoers <<EOF Defaults env_keep="http_proxy https_proxy ftp_proxy" EOF
[edit] Set the Hostname
OLD_HOSTNAME=$(hostname) echo "${NEW_HOSTNAME}" > /etc/hostname hostname "${NEW_HOSTNAME}" sed -re "s/${OLD_HOSTNAME}/${NEW_HOSTNAME}/g" -i /etc/hosts
[edit] SSH Won't Connect?
rm /etc/ssh/ssh_host_* dpkg-reconfigure openssh-server /etc/init.d/ssh restart
[edit] Set the Time Zone
dpkg-reconfigure tzdata
[edit] Set the Time According to time.nist.gov
service ntp stop
ntpdate -s time.nist.gov
service ntp start
[edit] Using the Hardware Clock
[edit] Display RTC's Time
hwclock -r
[edit] Set the System Time to that of the RTC
hwclock -s
[edit] Set the RTC's time to that of the System
hwclock -w