Skip to content

Instantly share code, notes, and snippets.

@daneko
Last active October 1, 2015 01:58
Show Gist options
  • Save daneko/1899713 to your computer and use it in GitHub Desktop.
Save daneko/1899713 to your computer and use it in GitHub Desktop.
VPS CloudCore 初期のCentOS6用環境構築メモ

多分Censt6.3

dashboard での作業

yum update -y
yum install openssh-clients
useradd daneko -g wheel
passwd daneko
visudo
# wheelに権限をつけたり付けなかったり

ローカルから公開キーを送りつけてノンパスログイン設定

su daneko
cd ~
mkdir .ssh
mv /path/to/id_rsa.pub .ssh/authorized_keys
chmod 600 .ssh/authorized_keys
chmod 700 .ssh
su
vi /etc/ssh/sshd_config
#PasswordAuthentication no
#PermitRootLogin no

service sshd restart

sshでログインしてできる作業

su
cd /tmp

yum install wget make gcc-c++ openssl-devel sqlite-devel readline-devel ncurses-devel zlib-devel bzip2-devel \
patch curl-devel expat-devel gettext-devel libcurl4-gnutls-dev libexpat1-dev libz-dev libssl-dev

wget http://ftp-srv2.kddilabs.jp/Linux/distributions/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -ivh remi-release-6.rpm

openssh6.1

yum install tcp_wrappers-devel libX11-devel libXt-devel libedit-devel krb5-devel krb5-libs glibc-devel imake
wget http://ftp.jaist.ac.jp/pub/OpenBSD/OpenSSH/portable/openssh-6.1p1.tar.gz
wget http://pkgs.fedoraproject.org/repo/pkgs/openssh/x11-ssh-askpass-1.2.4.1.tar.gz/8f2e41f3f7eaa8543a2440454637f3c3/x11-ssh-askpass-1.2.4.1.tar.gz

あとはサイトの通りに作業

# /etc/ssh/sshd_config.rpmnew をsshd_configにrenameして必要な設定をして使用する
service sshd restart

zsh

su
cd /tmp
wget "http://sourceforge.net/projects/zsh/files/zsh/5.0.2/zsh-5.0.2.tar.gz/download"
tar zxvf zsh-5.0.2.tar.gz

cd zsh-5.0.2
./configure
make
make install

which zshs
vi /etc/shells
#/usr/local/bin/zsh

python mercurial

su
cd /tmp

curl -kLO https://github.com/utahta/pythonbrew/raw/master/pythonbrew-install
chmod +x pythonbrew-install
./pythonbrew-install

source /etc/bashrc

pythonbrew install --configure="--with-zlib \
--with-bz2 \
--with-ssl \
--with-readline \
--with-ncurses \
--with-expat \
--with-sqlite3 \
--with-crypt \
--with-md5 \
--with-sha" 2.7.3

pythonbrew switch 2.7.3

pip install mercurial

git

su
cd /tmp
yum install perl-ExtUtils-MakeMaker
wget https://git-core.googlecode.com/files/git-1.8.1.1.tar.gz
tar zxvf git-1.8.1.1.tar.gz
cd git-1.8.1.1
./configure
make
make install

vim

hg clone https://vim.googlecode.com/hg
cd hg
./configure --with-features=huge --enable-multibyte --enable-cscope --disable-selinux
 
make 
make install

tmux

# yum install libevent-devel ← Versionの問題でソースから入れる
wget --no-check-certificate https://github.com/downloads/libevent/libevent/libevent-1.4.14b-stable.tar.gz
./configure
make
make install
 
wget http://downloads.sourceforge.net/tmux/tmux-1.7.tar.gz
cd tmux
./configure
make
make install
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/5/$basearch/
gpgcheck=0
enabled=1
diff -Nurp rpmbuild.orig/SPECS/openssh.spec rpmbuild/SPECS/openssh.spec
--- rpmbuild.orig/SPECS/openssh.spec 2012-08-22 20:57:16.000000000 +0900
+++ rpmbuild/SPECS/openssh.spec 2012-08-30 00:42:42.000000000 +0900
@@ -1,5 +1,5 @@
%define ver 6.1p1
-%define rel 1
+%define rel 1%{?dist}
# OpenSSH privilege separation requires a user & group ID
%define sshd_uid 74
@@ -24,11 +24,14 @@
%define gtk2 1
# Is this build for RHL 6.x?
-%define build6x 0
+%define build6x 1
# Do we want kerberos5 support (1=yes 0=no)
%define kerberos5 1
+# Do we want libedit support (1=yes 0=no)
+%define libedit 1
+
# Reserve options to override askpass settings with:
# rpm -ba|--rebuild --define 'skip_xxx 1'
%{?skip_x11_askpass:%define no_x11_askpass 1}
@@ -82,14 +85,14 @@ Group: Applications/Internet
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
Obsoletes: ssh
%if %{build6x}
-PreReq: initscripts >= 5.00
+Requires(pre): initscripts >= 5.00
%else
Requires: initscripts >= 5.20
%endif
BuildRequires: perl, openssl-devel, tcp_wrappers
BuildRequires: /bin/login
%if ! %{build6x}
-BuildPreReq: glibc-devel, pam
+BuildRequires(pre): glibc-devel, pam
%else
BuildRequires: /usr/include/security/pam_appl.h
%endif
@@ -103,6 +106,9 @@ BuildRequires: pkgconfig
BuildRequires: krb5-devel
BuildRequires: krb5-libs
%endif
+%if %{libedit}
+BuildRequires(pre): libedit, libedit-devel
+%endif
%package clients
Summary: OpenSSH clients.
@@ -209,7 +215,9 @@ echo K5DIR=$K5DIR
%if %{kerberos5}
--with-kerberos5=$K5DIR \
%endif
-
+%if %{libedit}
+ --with-libedit
+%endif
%if %{static_libcrypto}
perl -pi -e "s|-lcrypto|%{_libdir}/libcrypto.a|g" Makefile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment