OpenSSH for Windows: Quick Start Guide

OpenSSH for Windows: Quick Start Guide
Michael Johnson
youngmug@users.sourceforge.net
 
Updated 9 July 2004
 
For detailed instructions, please see readme.txt. If you have questions, please check the readme and the online FAQ before contacting me.
 
In the descriptions of what to type, I use standard command notation. Items enclosed in [] are optional. Text you need to replace with entries is enclosed in <>.
 
This document is based in large part on the Quick Start Guide for Network Simplicity OpenSSH on Windows by Mark Bradshaw.
 
 
PLEASE READ THROUGH THE FULL README BEFORE YOU ASK FOR HELP. MANY THINGS ARE EXPLAINED IN MORE DETAIL THERE.
 
 
 
Install
-------
 
Run the setup program and accept the defaults (all categories).
This will install the OpenSSH server and client in an appropiate place.
 
 
 
Configuration
-------------
1. Open a command prompt and change to the installation directory (Program Files/OpenSSH is the default).
 
2. CD into the bin directory.
 
3. Use mkgroup to create a group permissions file. For local groups, use the "-l" switch. For domain groups, use the "-d" switch.
    For both domain and local, it is best to run the command twice (remember to use >>, not >). If you use both, make sure to edit the file to remove any duplicate entires.
 
      mkgroup -l >> ../etc/group      (local groups)
      mkgroup -d >> ../etc/group      (domain groups)
 
4. Use mkpasswd to add authorized users into the passwd file. For local users, use the "-l" switch. For domain users, use the "-d" switch.
    For both domain and local, it is best to run the command twice (remember to use >>, not >). If you use both, make sure to edit the file to remove any duplicate entires.
 
      mkpasswd -l [-u <username>] >> ../etc/passwd      (local users)
      mkpasswd -d [-u <username>] >> ../etc/passwd      (domain users)
 
    NOTE: To add users from a domain that is not the primary domain of the machine, add the domain name after the user name.
    NOTE: Ommitting the username switch adds ALL users from the machine or domain, including service accounts and the Guest account.
 
5. Start the OpenSSH server.
 
      net start opensshd
 
6. Test the server. Using a seperate machine as the client is best. If you connect but the connection immediately gets dropped, reboot the machine with the server and try connecting again.
 
 
 
Usage and Important Notes
-------------------------
Remember that the CYGWIN OpenSSH utilities are not graphical and are command-line based. Look at PuTTY, SSH Secure Shell, etc for graphical configuration. For more advanced ways to use the programs, look at the manual pages in the documentation directory.
 
SSH (client program):
    ssh <user@servername>
 
SCP (file copy):
    scp <localfilename> <user@servername>:<destinationdirectory>
      or
    scp <user@servername>:<remotefilename> <localfilename>
      or
    scp <user@servername>:<remotefilename> <user@otherservername>:<destinationdirectory>
 
SFTP (ftp):
    sftp <user@servername>
 
 
NOTE: While regular SSH provides a familiar Windows commandline, SCP and SFTP as well as the passwd file use Unix-style paths. This is due partly to the Unix history of SSH, and to the Cygwin source of the tools.
 
Paths in SCP and SFTP as well as the home directory listing in passwd use Unix notation. To access directories outside of the OpenSSH directory structure, use the Cygdrive notation described in readme.txt. Further explanation is in readme.txt.
 
 
The /home Directory
-------------------
In the passwd file, you will notice that the user's home directory is set as /home/username, with username being the name of the account. In the default install, the /home directory is set to the default profile directory for all users. This is usually C:/Documents and Settings on Windows 2000 and XP, and C:/WINNT/Profiles on Windows NT 4.0. The location of /home can be edited to fit your special requirements by editing a registry key.
 
To change the Windows directory /home corresponds to, you will need to edit a registry entry under HKEY_LOCAL_MACHINE/SOFTWARE/Cygnus Solutions/Cygwin/mounts v2//home. The value of the key named "native" is the directory that /home is. If you want all your users to enter in a directory on your machine called F:/Users, change "native" to read F:/Users. By default, each user will then be placed in the directory F:/Users/username, where username is the name of the user account. To place the user directly under f:/Users, change the home directory in passwd to /home.
 
Troubleshooting
---------------
Troubleshooting tips can be found in the full readme.
 
关于 /home 目录
              在 Windows 2000 and XP 中,/home默认是在 C:/Documents and Settings
              在 Windows NT 4.0 中,/home默认是在 C:/WINNT/Profiles
要改默认的/home目录要在regedit中进行修改:,
Windows Registry Editor Version 5.00
 
[HKEY_LOCAL_MACHINE/SOFTWARE/Cygnus Solutions/Cygwin/mounts v2//home]
"native"="C://Program Files//OpenSSH//home"
"flags"=dword:0000000a
 
"native" 改成你自己的 /home 还有就是用户名是默认的登陆目录,比如用户名: linuxborder 那你进入的目录是 /home/linuxborder 你可以通过命令切换到根目录中,也就是 /home
 
 
 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值