Feb 252008
 


Did you know, you can SSH into a PC or a Windows Server? Copy files using SCP ? or even SFTP (Secure FTP) onto a Windows machine??

Yes, you can run OpenSSH, an OpenSource Secure Shell Server for UNIX and LINUX systems. “OpenSSH for Windows” is a free package that installs a minimal OpenSSH server and client utilities in the Cygwin package without needing the full Cygwin installation.

The “OpenSSH for Windows” package provides full SSH/SCP/SFTP support. SSH terminal support provides a familiar Windows Command prompt, while retaining Unix/Cygwin-style paths for SCP and SFTP. This is a unix style command prompt only access to windows server to run commands or copy files using SCP or SFTP. Access can be setup for either a Domain user or a local user on the system.

“OpenSSH for Windows” works well on Windows NT, Windows 2000, Windows XP and WIndows 2003. Simply download and install the package from here.

Once done, from the command prompt navigate to “C:\Program Files\OpenSSH\bin” folder as follows:

C:\> cd “C:\Program files\OpenSSH\bin”

Add Group Permissions

Run the following command to create a group permissions file (UNIX Style /etc/group file)

C:\Program files\OpenSSH\bin> mkgroup -l >> ..\etc\group

where -l indicates local group
-d would add domain groups

Add Authorized users (create unix style /etc/passwd file)

C:\Program files\OpenSSH\bin> mkpasswd -l -u winsockfix >> ..\etc\passwd

where -l indicates a local user
-d would add a domain user
-u indicates the username

We are done with the config now. Reboot the PC or Server now.

Start the OpenSSH Server

C:\>net start opensshd

Clients

To SSH to another system:

ssh <user@servername>

To SCP

scp <localfilename> <user@servername>:<destinationdirectory>
or
scp <user@servername>:<remotefilename> <localfilename>
or
scp <user@servername>:<remotefilename> <user@otherservername>:<destinationdirectory>

To SFTP (Secure ftp):

sftp <user@servername>

For more information and download, click here for the project page on Sourceforge.

Incoming search terms:

  4 Responses to “How to run OpenSSH on a Windows. SSH,SCP,SFTP to Windows”

  1. If you’re simply looking for an ssh client to do outbound connections from Windows platforms, try AbsoluteTelnet. It is a native Windows application with SSH, telnet, and full GUI SFTP support. And yes, it works with Vista! Check my sig for the link.

    Brian Pence
    Celestial Software

  2. How can I run a bat file that contains sftp commands?

  3. Hi

    Putty is an awesome ssh client that always served me well. Also winscp is great for transferring files(FTP, SFTP, SCP). both are free software and can be found with google.

    @Miguel

    You need a commandline driven ftp client that can be instructed to do your bidding from the batch file.

  4. For the life of me I can’t get this to work with w7 on the server machine!!!!!!

    I have a user account created via Windows
    when I type mkgroup and the mkpasswd nothing shows up under that line in cmd

    I don’t know how to add it or make the password.

    I am so stumped right now. Is there an installer I can run that will do all this for me?

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>