CentOS6.3でsshをproxy経由で使用する方法

だいたいWin7でやったことと同じ。

Githubアカウントを作る。(省略)

SSH keypairを作りGithubへ登録。

$ ssh-keygen -t rsa -C "自分のメールアドレス"

「~/.ssh」配下に諸々の鍵が生成。GithubSSH Keysページhttps://github.com/settings/sshからpublic key(id_rsa.pub)を登録。

接続テスト→失敗(省略)

proxy超えをするための設定

「~/.ssh」配下にconfigを作成。以下を記述する。
先に補足すると

    • connectをどこかから入手する。
    • ★proxy.example.com:port★は各々の環境に合わせて書き換える。

参考。こちらSSH through HTTP proxy

$ vim /etc/ssh/sshd_config

Port 443

再起動も忘れずに

$ sudo /etc/init.d/ssh restart

connectを入手しましょう

$ wget http://www.meadowy.org/~gotoh/ssh/connect.c
$ gcc connect.c -o connect
$ sudo cp connect /usr/local/bin/ ; chmod +x /usr/local/bin/connect

~/.ssh/configファイルを編集する

ProxyCommand connect -H ★proxy.example.com:port★ %h %p

Host github.com
User git
Port 22
Hostname github.com
IdentityFile ~/.ssh/id_rsa
TCPKeepAlive yes
IdentitiesOnly yes

Host ssh.github.com
User git
Port 443
Hostname ssh.github.com
IdentityFile ~/.ssh/id_rsa
TCPKeepAlive yes
IdentitiesOnly yes

接続テスト〜そして成功へ

$ ssh git@github.com

Warning: Permanently added '[ssh.github.com]:443' (RSA) to the list of known hosts.
Hi ★★★(名前ね)! You've successfully authenticated, but GitHub does not provide shell access.
Connection to ssh.github.com closed.

Win7版と違ってconnectを自分で用意する必要があるので注意。お疲れ様でした。

CentOS6.3で日本語入力するまでの道のり

  • 全角/半角キーがきかない
  • 記号周りが押したキーと入力されるキーとで一致しない

などの症状が出ていたのでいろいろ確認したときのメモ。

結論としては「日本語環境を何も入れてなかった」に尽きます。しょんぼり。

日本語関連のパッケージをインストール

まず日本語関連のパッケージをインストール。

# yum -y groupinstall "Japanese Support"

(これはお好み)システムの文字セットを変更。

# vim /etc/sysconfig/i18n

LANG="ja_JP.UTF-8"

キーボードを日本語に変更

キーボードの変更を確認。(たぶん"us"になってる)

# vim /etc/sysconfig/keyboard

KEYTABLE="jp106"

会社PCからGithubであれこれやる環境を整えたメモ

会社環境からGithubにあれこれやるための環境を整えた時のメモ。

  • Windows7 Enterprise 64bit
  • 社内Proxyあり
  • 参考にした方 先輩という名の人柱

Githubアカウントを作る。(省略)

Github for WindowsをこちらGitHub Desktop | Simple collaboration from your desktopから入手、インストール。


msysgitをこちらGoogle Code Archive - Long-term storage for Google Code Project Hosting.から入手、インストール。


SSH keypairを作りGithubへ登録。

Windowsスタートメニュー -> Git -> Git Bash」から

$ ssh-keygen -t rsa -C "自分のメールアドレス"

「C:\Users/hogehoge/.ssh」配下に諸々の鍵が生成。GithubSSH Keysページhttps://github.com/settings/sshからpublic key(id_rsa.pub)を登録。

接続テスト…だが…

$ ssh git@github.com

…失敗。ですよねー。(たぶんProxy経由でなければここで成功する、と思う)

proxy超えをするための設定

「C:\Users/hogehoge/.ssh」配下にconfigを作成。以下を記述する。
先に補足すると

    • connect.exeは【C:\Program Files\Git\bin】の配下にあるので気にしない。
    • ★proxy.example.com:port★は各々の環境に合わせて書き換える。

ProxyCommand connect.exe -H ★proxy.example.com:port★ %h %p

Host github.com
User git
Port 22
Hostname github.com
IdentityFile "C:\Document and Settings\username\\.ssh\id_rsa"
TCPKeepAlive yes
IdentitiesOnly yes

Host ssh.github.com
User git
Port 443
Hostname ssh.github.com
IdentityFile "C:\Document and Settings\username\\.ssh\id_rsa"
TCPKeepAlive yes
IdentitiesOnly yes

以下ページを参考に頑張る。
GitHubにプロキシ経由でpushする(Windows環境) - wadahiroの日記
Windowsで社内LANからプロキシを超えてGitHubにSSH接続する方法 | REFLECTDESIGN
懶人日記: ssh over proxyでgithubをアクセスする(Windows)

接続テスト〜そして成功へ

$ ssh git@github.com

Warning: Permanently added '[ssh.github.com]:443' (RSA) to the list of known hosts.
Hi ★★★(名前ね)! You've successfully authenticated, but GitHub does not provide shell access.
Connection to ssh.github.com closed.

成功するはず。お疲れ様でした。

CentOS6.3でyumとwgetをproxy経由で使う方法

yumの設定

yumは「/etc/yum.conf」にproxyを設定してあげます。

# proxy setting
proxy=http://hogehoge.proxy.server:xxxx(port番号)
proxy_username=username
proxy_password=password

wgetの設定

wgetは「~/.wgetrc」にproxyを設定してあげます。

# proxy setting
proxy=http://hogehoge.proxy.server:xxxx(port番号)
proxy_username=username
proxy_password=password

Vim設定メモ

Mac OSX LionでVimを始めてみた際の設定めも。
Vim自体は最初から入っているので、その(初歩的な)設定を記述してみた。



そもそもだけども、Vimは入ってるけど.vimrcは無いのね。作りましょう。

$touch ~/.vimrc

作成した.vimrcに色々と設定を記述。参考にしたのはviコマンド(vimコマンド)一覧(検索・置換)とか、viエディタでバックファイルが作られないようにしたい - ITmedia エンタープライズなど。

"表示周り
set number "行番号表示
set title "編集中のファイル名を表示
set ruler "ルーラーの表示
set showcmd "入力中のコマンドをステータスに表示する
set showmatch "括弧入力時の対応する括弧を表示
set laststatus=2 "ステータスラインを常に表示

"コーディング周り
syntax on "カラー表示
set smartindent "オートインデント
set expandtab "タブの代わりに空白文字挿入
set ts=4 sw=4 sts=0 "タブは半角4文字分のスペース

ひとまずこれで最低限は動けるようになったかしら?

※追記
これも足しておこうっと。

"ファイルの文字コードを自動認識する
set fileencodings=iso-2022-jp,utf-8,cp932,euc-jp,default,latin

"自動バックアップオフ
set nobk