DreamTeamDownloads1, FTP Help, Movies, Bollywood, Applications, etc. & Mature Sex Forum, Rapidshare, Filefactory, Freakshare, Rapidgator, Turbobit, & More MULTI Filehosts

DreamTeamDownloads1, FTP Help, Movies, Bollywood, Applications, etc. & Mature Sex Forum, Rapidshare, Filefactory, Freakshare, Rapidgator, Turbobit, & More MULTI Filehosts (http://www.dreamteamdownloads1.com/index.php)
-   How To - (Tips and Tricks) & NEWS (http://www.dreamteamdownloads1.com/forumdisplay.php?f=98)
-   -   How To Get SSH Command-Line Access to Windows 7 Using Cygwin (http://www.dreamteamdownloads1.com/showthread.php?t=1053)

Ladybbird 07-03-11 05:33

How To Get SSH Command-Line Access to Windows 7 Using Cygwin
 
http://www.howtogeek.com/wp-content/...01/banner3.png
Are you comfortable with Linux/Unix and want SSH access to your Windows 7 machine? Cygwin provides this functionality and gives you a familiar environment to work with in a few simple steps.




Installing OpenSSH


OpenSSH is what we’ll be using, so if you don’t have it installed, find Cygwin’s setup.exe file and run it.


http://www.howtogeek.com/wp-content/...7opensetup.png
You can keep all of the same defaults as when you originally set up Cygwin. On the package selection screen, search for “open” and look under the “Net” menu.
http://www.howtogeek.com/wp-content/...allopenssh.png
You’ll see a package called “openssh”. Click under the “New” column, where it says “Skip” until you see an X appear in the “Bin?” column. Look at the previous screenshot for where to click if you’re confused. Hit “Next” and finish up the rest of the setup process, just like you did last time.


Configuring OpenSSH in Cygwin


Unlike in most Linux distros, OpenSSH won’t automatically configure itself to run and just work. We need to perform a few easy steps. First, right-click your Cygwin shortcut, and click on “Run as administrator”:
http://www.howtogeek.com/wp-content/...runasadmin.png
This will make sure we have the proper privileges for everything. You’ll see an empty Cygwin window come up.
http://www.howtogeek.com/wp-content/...gwinwindow.png
Enter the following command:
ssh-host-config
http://www.howtogeek.com/wp-content/...02command1.png
You’ll see the script generate some default files, and then you’ll be prompted for whether or not you want to enable “Privilege Separation.” It’s on by default in standard installations of OpenSSH on other systems, so go ahead and say “yes” to the prompt.
http://www.howtogeek.com/wp-content/...vsep_thumb.png
You’ll be prompted to create a new account with special privileges. Select “yes” and the script will continue.
http://www.howtogeek.com/wp-content/...acct_thumb.png
Next, you’ll be asked if you want sshd to run as a service. This will allow you to get SSH access regardless of whether or not Cygwin is currently running, which is what we want. Go ahead and hit “yes” to continue.
http://www.howtogeek.com/wp-content/...vice_thumb.png
Next, you’ll be asked to enter a value for the daemon. Enter the following:
ntsec
http://www.howtogeek.com/wp-content/...tsec_thumb.png
You’ll see the script give you some information on your system and then it will ask you to create a privileged account with the default username “cyg_server”. The default works well, so type “no” when it asks you if you want to use a different account name, although you can change this if you really like.
http://www.howtogeek.com/wp-content/...rver_thumb.png
Of course, you’ll have to enter a password for this account as well.
http://www.howtogeek.com/wp-content/...08password.png
Cygwin will show you your password in plain text for verification, so be sure you’re in a secure place. You’ll see some extra info come up and if all’s well, you’ll get a message that says it successfully completed.
http://www.howtogeek.com/wp-content/...nfig_thumb.png
You can either restart, or enter the following command to start the sshd service:
net start sshd
http://www.howtogeek.com/wp-content/...tstartsshd.png


Now, you can type “exit” to close this Cygwin instance.


User Configuration of SSH

Next, we’ll create the appropriate SSH keys for your user account. Open up Cygwin normally, and enter the following command:
ssh-user-config
http://www.howtogeek.com/wp-content/...userconfig.png
You’ll be asked to create specific keys for your user account, so use what you need. I went ahead and said “no” to the first question, and “yes” to the second.
http://www.howtogeek.com/wp-content/...rase_thumb.png
SSH2 is more secure, so that’s what I recommend to you. After entering a password, you’ll be asked if you want to use that ID to access your machine. Type “yes”.
http://www.howtogeek.com/wp-content/...isid_thumb.png
Next, you’ll be asked to create an SSH2 DSA ID file, if you want to use password-less access. I declined at this step.
http://www.howtogeek.com/wp-content/...odsa_thumb.png
That’s it! You’re all configured. If you want to test your configuration really quickly, enter the following command in your Cygwin window:
ssh –v localhost
http://www.howtogeek.com/wp-content/...test_thumb.png
The –v option stands for “verbose” and gives you all of the details of the process. You’ll be asked if you want to continue connecting, so enter “yes” and then enter your password at the prompt. Remember that when you enter your username, it is case-sensitive!
http://www.howtogeek.com/wp-content/...exit_thumb.png
If everything worked out well, you’ll see a normal bash prompt.


Minor Issues

If you find yourself stuck at any of the configuration steps, make sure that the Windows User Account you’re running has Administrative access. You may get weird errors if you try to run the host configuration as a normal user, so make sure you run Cygwin with admin privileges during that step. If, when you exit, you get a prompt about leaving your batch jobs running, you can hit “no” to terminate them.
Lastly, if you test SSH access from another machine and get an error, make sure that your firewall isn’t blocking access to port 22 (or 23 if you’re using SFTP).
This works extremely well if you like the ability to get SSH/SFTP access to your files on a Windows 7 machine and you also want a familiar shell to do that with. Cygwin mounts Windows drives to “/cygdrive/driveletter” in case you were wondering
Thanks to Geek Yatri


All times are GMT. The time now is 09:17.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
SEO by vBSEO 3.5.2