在Cygwin上安裝ssh伺服器及中文显示
来源:互联网 发布:网络销售培训介绍 编辑:程序博客网 时间:2024/04/29 22:27
簡介
簡單的說,cygwin在windows上提供了一個像linux (Linux-like)的環境,可以讓使用者在windows上執行linux的程式。
嚴格地說, cygwin 是模擬了 GNU 的環境, 而不是 linux 的環境,藉著 cygwin 的函式庫(library), 在 Win32 API 環境上提供了像 linux 般的API 環境. 利用 Cygwin, 你可以:
- 將 linux 上的程式移植到 Windows , 而不必做重大的修改,只需將原始碼拿來作 configure 與 make 就好了。
- 使用常用的 linux 工具程式,如grep, sed, awk等。
- 撰寫 Win32 native console 或是 GUI 應用程式。
發展歷史
Cygwin發展於1995年,Cygnus Solutions 公司 (已為 redhat 所併購) 以自由軟體基金會的 gnu 工具為基礎, 將它移植到 windows 上, 它一直都是自由軟體。 初期只有命令列視窗 bash 及編譯器 gcc 等等開發工具可以使用; 現在則連 X 視窗系統都已移植成功,目前正將 X 視窗系統下的應用軟體逐漸移植過來。
下載與安裝
- 連至 www.cygwin.com 下載 setup.exe
- 執行 setup.exe , 選取Download from Internet
- 選取所需套件 // 建議全選devel, lib等分類的所有套件
- 執行 setup.exe , 選取Install from Local directory安裝套件 //最好選取 All user
- 選取所有套件
- 執行桌面上的 Cygwin 的 icon 圖示即可執行此一 Cygwin 環境。// 視窗大小可由icon 圖示右點按 選取調整字型 及佈置
step by step 可參考 http://linux.tnc.edu.tw/techdoc/shell/x52.html
設定
安裝好cygwin之後,發現無法在console看到中文,必須做以下設定
- ~/.bashrc stty cs8 -istrip
stty pass8
export LANG=C
export LC_CTYPE=iso-8859-1
alias ls="ls --show-control-chars"
alias crxvt='rxvt -fm "細明體-16" -fn "細明體-16" -km big5 -e bash --login -i' - ~/.inputrcset meta-flag on
set input-meta on
set convert-meta off
set output-meta on
參考:
- http://sources.redhat.com/ml/cygwin/2001-07/msg00311.html
- http://www2.cs.uh.edu/~kcting/blog/index.cgi/opencontent/cygwin/CygwinHOWTO.html
應用
在Cygwin上安裝ssh伺服器
- OS修改環境變數:path增加d:/cygwin/bin
- OS增加環境變數:CYGWIN=ntsec tty
- Cygwin安裝必要的套件:OpenSSH,cygrunsrv
- Cygwin設定OpenSSH:
- 執行 ssh-host-config
- Should privilege separation be used? (yes/no) :yes
- Should this script create a local user 'sshd' on this machine? (yes/no) :yes
- Do you want to install sshd as service? (yes/no) :yes
- Default is "ntsec" . CYGWIN=ntsec tty
- 手動啟動OpenSSH服務:net start sshd
- 手動關閉OpenSSH服務:net stop sshd
參考:
http://pigtail.net/LRP/printsrv/cygwin-sshd.html
網路資源
- 在Cygwin上安裝ssh伺服器及中文显示
- [收藏] 在Cygwin上安裝ssh伺服器!
- [收藏] 在Cygwin上安裝ssh伺服器!
- [收藏] 在Cygwin上安裝ssh伺服器!
- cygwin 输入显示中文
- Cygwin中文显示
- cygwin显示中文目录
- cygwin显示中文
- 安装cygwin及开启ssh
- cygwin中文输入和显示
- cygwin 终端中文显示配置
- ssh显示中文乱码及消除高亮显示
- cygwin中文输入和中文显示
- SSH 显示中文乱码
- SSH 显示中文乱码
- SSH 显示中文乱码
- SSH 显示中文乱码
- SSH 显示中文乱码
- ATL介绍
- HTML语法大全
- about face2.0——第四章(3):其他类型调研
- java聊天室
- 卢西 - 赤道和北极
- 在Cygwin上安裝ssh伺服器及中文显示
- 唐伯虎《桃花庵歌》
- TextArea在xslt中的bug及解决方法
- 通过试验探索 Access 2000/XP 数据库的最佳 NTFS 权限设置 (转)
- IIS服务的命令行方式重启命令
- CYGWIN设置
- ATL中的集合和枚举
- Linux下常用压缩格式的压缩与解压方法
- 使用jsp实现word、excel格式报表打印