`
dch1287
  • 浏览: 123232 次
  • 性别: Icon_minigender_1
  • 来自: 魔都
社区版块
存档分类
最新评论

Free Unix Tools (ssh, bash, etc) under Windows

阅读更多
The Cygwin tools are ports of the popular GNU development tools for Windows 9x/ME/NT/2000. They run thanks to the Cygwin library which provides the UNIX system calls and environment these programs expect. For example you find the popular Commandline Secure Shell Tools (SSH) to create a secure terminal emulation from Windows to Unix systems.

The following packages are available with the current release:

ash autoconf automake bash binutils bison byacc bzip2 clear cpio crypt cvs cygrunsrv cygwin dejagnu diff expect file fileutils findutils flex gawk gcc gdb gdbm gettext ghostscript gperf grep groff gzip inetutils irc jbigkit jpeg less libpng login lynx m4 make man mingw mt mutt ncftp ncurses newlib-man opengl openssh openssl patch pcre perl popt postgresql python readline regex rxvt sed sh-utils squid ssmtp tar tcltk tcsh termcap tetex-beta texinfo textutils tiff time unzip vim w32api wget which xpm xpm-nox zip zlib

Installation

Download the "setup.exe" Program from Cygwin (http://www.cygwin.com/setup.exe)


Run "setup.exe" from your download directory.

This will then download the list of available packages, and offer to install them for you. There are a number of options within setup to control installation details.

Choose "Download from Internet to Current Directory" from the setup Program

The selected packages are now downloaded to your local drive.

Choose "Install from Current Directory" from the setup Program

When installing, you will have to specify:

- Install root directory (e.g. D:\cygwin)
- Default Text File Type ("DOS" or "Unix")
- Install For ("All" or "Just Me")

Configuration Tips

Make sure you have set the HOME environment variable (e.g. C:\Home\Zahn)

Check and add your mounts with

mount

D:\Cygwin\bin on /usr/bin type system (binmode)
D:\Cygwin\lib on /usr/lib type system (binmode)
D:\Cygwin on / type system (binmode)
c: on /cygdrive/c type user (binmode,noumount)
d: on /cygdrive/d type user (binmode,noumount)
e: on /cygdrive/e type user (binmode,noumount)

If you need additional mount points create the directories and mount them e.g.

mount c:/uxhome /home/zahn

Check the automatically created mount points

The setup program will setup the needed mount points automatically. You can find them in the Windows registry under

HKEY_CURRENT_USER\Software\Cygnus\Cygwin\mounts v2
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus\Cygwin\mounts v2

How to use Device Files for tar ?

There is no need to create a POSIX /dev directory as it is simulated within Cygwin automatically. It supports the following devices: /dev/null, /dev/zero, /dev/tty, /dev/ttyX, /dev/ptmx, /dev/comX (the serial ports), /dev/windows (the windows message queue), /dev/random and /dev/urandom. These devices cannot be seen with the command ls /dev although commands such as ls /dev/tty work fine.

The Win32 device name for a partition is the drive letter with leading \\.\, so the floppy would be \\.\A:, the first partition typically \\.\C:. Complete drives (except floppies and CD-ROMS which are supported as partitions only) are named \\.\PHYSICALDRIVEx. The x is the drive number which you can check in the disk manager. Each drive line has prepended the text "Disk x".

To access tape drives the Win32 file name \\.\TAPEx is used. For example the first installed tape device is named \\.\tape0.

The naming convention is simple: The name of the POSIX device has to begin with /dev/ and the rest is as you like. The only exception are tape devices. To identify if the tape device is used as a rewind or a no-rewind device the name must not begin with n (rewind) or has to begin with n (no-rewind).

Some examples:

mount -b //./A: /dev/fd0 # mount floppy as raw block special
mount -b //./tape0 /dev/st0 # mount 1. tape as rewind device
mount -b //./tape0 /dev/nst0 # ...and as the no-rewind device

Note the usage of the -b option. It is best to include the -b option when mounting these devices to ensure that all file I/O is in "binary mode". Enter -s option to add mount point to system-wide registry location.

Now you can use tar as follows:

tar xvf /dev/st0 <dir>

Create and copy .bashrc to $HOME

The BASH shell can be configured with the configuration file $HOME/.bashrc (e.g)

# Aliases
alias more=less
alias up='cd ..'
alias ll='ls -la'
alias ls='ls -F'
alias ps='ps -Wl'
alias home='cd $HOME'
alias which='type -path'
alias unix2dos='recode lat1:ibmpc'
alias dos2unix='recode ibmpc:lat1'
alias h='history'

# Make Bash 8bit clean
set meta-flag on
set convert-meta off
set output-meta on
set completion-ignore-case on

# Set Prompt
PS1="`tput smso``whoami`@\h>`tput rmso` "
export PS1
PS2="> "
export PS2

Start BASH and enjoy the Unix Tools like SSH, SCP etc.

zahn@SMARAGD>ssh dbhost.akadia.com

We suggest to set the TERM variable for programs (e.g. vi) which use a correct terminal emulation to the following values:

Linux: TERM=linux; export TERM
Sun: TERM=ansi; export TERM

Example

The following screenshots shows a secure terminal emulation (SSH) from Windows to Unix using Cygwin's bash shell. The bash shell, like many other Unix utilities is ported to Windows.


http://www.akadia.com/services/cygwin_tools.html
分享到:
评论

相关推荐

    UnixToolBox.zip

    UnixToolBox可能包含一个Windows下的Bash环境,让用户可以在Windows下使用Unix风格的命令行。 10. **cut, paste, sort, uniq, wc**: 这些是Unix/Linux中的一系列文本处理工具,用于切割、拼接、排序、去重和计算...

    Unix Power Tools, 3rd Edition.pdf

    除了有关Linux、Darwin和BSD的重要信息外,Unix Power Tools第三版现在还提供了更多关于bash、zsh和其他新shell的介绍,以及有关现代实用程序和应用程序的讨论。几个部分集中讨论安全和互联网接入。还有一个新的篇章...

    Freeradius和cisco ssh身份验证

    FreeRADIUS是一款强大的远程认证授权服务软件,常用于网络设备的身份验证,如SSH登录、无线接入点、PPP拨号等。结合Cisco交换机的SSH(Secure Shell)进行AAA(Authentication, Authorization, and Accounting,即...

    ssh trial--windows

    2. Git Bash:Git自带了一个模仿Unix/Linux命令行环境的工具,包括SSH功能。安装Git后,用户可以直接在Git Bash中运行SSH命令。 3. Windows Subsystem for Linux (WSL):这是Windows的一个特性,允许直接在Windows...

    解决ssh远程登陆linux显示-bash-4.1$的问题

    cp -pr /etc/skel/.bash* /home/test/ #/home/test是用户目录 改变用户家目录:usermod -md /tmptest test 以上就是小编为大家带来的解决ssh远程登陆linux显示-bash-4.1$的问题全部内容了,希望大家多多支持软件开发...

    windows下的unix

    安装Cygwin时,用户会得到一个包含各种Unix工具和库的集合,如bash shell、gcc编译器、make构建工具等,这些都能在Windows环境下运行。 通过Cygwin,Windows用户可以享受以下几点好处: 1. **命令行接口(CLI)**...

    sshshell.zip

    在IT领域,SSHshell是Linux或Unix类系统中常用的一种命令行接口,用于远程控制和管理服务器。通过SSH,用户可以执行命令、传输文件,而不用担心数据被窃听或篡改。 首先,我们要理解SSH的工作原理。它使用公钥加密...

    Unix_Advanced Bash-Scripting Guide_6.0

    《Unix Advanced Bash-Scripting Guide 6.0》是一本专为Unix系统用户设计的高级Bash脚本指南,被誉为Unix脚本领域的经典之作。这本书深入浅出地讲解了如何利用Bash shell编写高效、可维护的脚本,是Unix/Linux用户...

    gitBash 客户端 ssh 服务器远程登陆

    GitBash是一款为Windows系统提供类Unix shell环境的工具,它内置了Git命令行接口,同时也包括其他Unix-like命令,如ssh,使得用户在Windows环境下也能方便地进行远程服务器操作。 首先,让我们详细了解SSH(Secure ...

    bash v203- bash的windows本地实现

    “bash v203- bash的windows本地实现” 指的是一个在Windows操作系统上运行的Bash shell版本2.03,它不再依赖于像CygWin这样的模拟Unix环境。这意味着用户可以在Windows系统下直接使用Bash命令行工具,体验与Linux或...

    过rsync inotify-tools ssh实现触发式远程实时同步

    ### rsync + inotify-tools + SSH 实现触发式远程实时同步 #### 一、概述 在数据同步领域,实现高效且自动化的文件同步是至关重要的。对于需要在两台或多台服务器之间保持文件同步的场景,传统的定时同步方法可能...

    UNIX Power Tools第三版

    - **跨平台访问**:新增了一章介绍如何从Windows平台访问Unix系统。 - **软件安装与包管理**:扩展了有关软件安装和包管理的内容。 - **Perl和Python基本介绍**:提供了Perl和Python这两种常用脚本语言的基础知识。 ...

    GitBash windows 64位版本

    GitBash是一款在Windows操作系统上运行的命令行工具,它为用户提供了类Unix shell环境,以便于使用Git进行版本控制。GitBash包含了Git的所有功能,并且还包含了其他Unix工具,如bash shell、grep、sed、awk等,使得...

    UNIX Power Tools 3rd Edition

    《UNIX Power Tools 3rd Edition》是一本专为Unix系统用户和管理员精心编写的实用指南。这本书详尽地涵盖了Unix操作系统中的各种高级技巧和工具,旨在帮助用户更高效、更深入地利用Unix环境。1130页的篇幅使得它成为...

    bash脚本中将密码传递给ssh/scp命令方法详解

    在Linux系统中,有时我们需要通过bash脚本来自动化执行SSH(Secure SHell)或SCP(Secure Copy)命令,例如在远程服务器之间传输文件。然而,这些命令通常需要用户提供密码,这在脚本化环境中是不理想的,因为手动...

    bash3.0 bash3.2 under aix 5.1 5.2

    bash-3.0-1.aix5.1.ppc.rpm bash-3.2-1.aix5.2.ppc.rpm rpm.rte 其中rpm.rte 为aix下支持rpm的程序包 大家也可以到这里去下载 http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/download.html

    unix power tools

    《UNIX Power Tools》这本书是关于在UNIX操作系统中高效工作的指南。书中的内容涵盖了大量实用技巧和工具,旨在帮助用户充分利用UNIX系统提供的强大功能。 1. **UNIX的特殊之处** - UNIX系统的特别之处在于其模块...

    Git Bash windows 64 git2.16.2

    Git Bash是Git在Windows操作系统上的一个实用工具,它为用户提供了类Unix的命令行环境,使得Windows用户可以方便地使用Git的各种版本控制功能。Git是由林纳斯·托瓦兹(Linus Torvalds)创建的分布式版本控制系统,...

    platform-tools_r28.0.3-windows.zip

    平台工具包"platform-tools_r28.0.3-windows.zip"是Android开发不可或缺的一部分,它由Google提供,用于与Android设备进行交互。这个压缩包包含了Android Debug Bridge(ADB)和其他必要的开发工具,允许开发者进行...

    bash-4.2 for unix linux

    标题"bash-4.2 for unix linux"指的是Bash shell的一个特定版本——4.2,这个版本是针对Unix和Linux系统设计的。Bash shell继承了Steve Bourne的原始shell(sh)的特点,并增加了许多扩展功能,使其成为Linux和Unix...

Global site tag (gtag.js) - Google Analytics