How to access SSH on Windows 7 using Cygwin
If you are comfortable using Linux / Unix and want to access SSH on a Windows 7 computer, you can use Cygwin. This Windows Linux emulator provides this functionality and gives you a familiar work environment with just a few simple steps.
This article does not cover the installation and configuration of Cygwin, if you do not know how to do it, you can refer to the article Using Linux in Windows with Cygwin.
Install OpenSSH
Here we will use OpenSSH, so if not installed, find the setup.exe file and run it.
You can keep all the default values just like when you set up the original Cygwin. On the package selection screen, search for ' open ' and look in the ' Net ' menu.
You will see a package called " openssh ", click on the " New " column and see " Skip " until the X appears in the " Bin? " Column. Look at the screenshot above to know what to choose if you're confused. Then click " Next" and complete the remaining setup process.
Configure OpenSSH in Cygwin
Unlike most Linux distributions, OpenSSH will not automatically configure to run and operate. We need to take a few simple steps. First, right click on Cygwin shortcut and click on ' Run as administrator '.
This ensures you have the right rights to do everything. You will then see an empty Cygwin window appear.
Enter the following command:
ssh-host-config
You should see the script create some default files and then you will be prompted if you want to enable ' Privilege Separation '. By default, it will be enabled in standard OpenSSH settings on other systems, so continue and select " yes ".
You will be prompted to create a new account with special permissions, select ' yes ' and the script will continue.
Next, you will be asked if you want to run sshd as a service. This gives you SSH access even when Cygwin is not running. If yes, type yes to continue.
Next, you will be asked to enter a value for the daemon. Enter the following command:
ntsec
You will see the script provide some information on the system and ask you to create a special account with the default username ' cyg_server '. Leave the default settings unchanged and type ' no ' when you ask if you use a different account name, although you can change this if you like.
Of course, you will also have to enter the password for this account.
Cygwin will display your password in plain text for verification, so make sure you are in a safe place. You will see some additional information appear and if all is done correctly, you will receive a message telling you that the configuration is complete.
You can restart or enter the following command to start the sshd service:
net start sshd
Now, you can type " exit " to close Cygwin.
User configuration of SSH
Next, you need to create the appropriate SSH keys for your user account. Open normal Cygwin and enter the following command:
ssh-user-config
You will be asked to create specific keys for your user account, so use what you need. In this example, type ' no ' for the first question and ' yes ' for the second question.
SSH2 is more secure, so you can use it. After entering the password, you will be asked if you want to use that ID to access your device, type ' yes '.
Next, you will be asked to create an SSH2 DSA ID file, if you want to use access without a password, you can decline at this step.
So you've configured it. If you want to check the quick configuration, enter the following command in the Cygwin window:
ssh –v localhost
The -v option stands for "verbose" and gives you all the information of the process. You will be asked if you want to continue connecting, so enter ' yes ' and then enter your password at the prompt. Remember that when entering your username, it will be case sensitive.
If everything works well, you will see the usual bash prompt.
Problems when setting up SSH access
If you are stuck at any configuration step, make sure that your Windows User Account is running with administrative access. You can get some strange errors if you run a host request with a normal user account, so be sure to run Cygwin with admin rights during that step. If you exit, you receive a prompt about the batch job running, press no to stop this.
Finally, if you check for SSH access from another computer and see an error, make sure your firewall doesn't block access to port 22 (or 23 if using SFTP).
This method works very well if you like the ability to access SSH / SFTP on files on a Windows 7 computer and you also want a familiar shell to do so. If you're wondering, Cygwin attaches a Windows drive to '/ cygdrive / driveletter '.
I wish you all success!
See more:
- How to activate and use SSH commands on Windows 10
- Back up the entire website with SSH Command Line
- How to install OpenSSH on Windows 10
You should read it
- 5 best command line emulation software for Windows 10
- Forget the GUI, the Command Line is returning
- 10 useful commands in Windows you should know
- 10 tips for using Command Line Windows 10 users should know
- Command line parameter in C
- Instructions for using Command Prompt
- All cmd and dos commands on Windows
- How to use the command history function in Command Prompt
May be interested
- How to access Linux files on Windows 10windows 10, april 2019 update brings a long-awaited feature: support for easy access, viewing and even modification of windows subsystem for linux files (wsl) from file explorer or via stream command.
- MS Access 2003 - Lesson 1: Chapter 1: Terminology Accessthis chapter is the first step in learning and familiarizing with basic terms, as well as how to start and exit access. you will get help and master the outline of what you can do with access.
- MS Access 2003 - Lesson 2: Using an Access environmentbefore working with access, you need to start the program. starting access has many ways like starting other windows programs.
- MS Access 2003 - Lesson 26: Adjust the print pagelike many programs, access provides all the features of the window environment. access uses the print utilities provided by the windows environment, which means it can use any windows printer to use.
- How to access files on Windows 10 remotely with OneDrivethere are many ways to access remote computers, of which the two most popular are google remote desktop and teamviewer. however, if you only need access to files and folders, don't miss onedrive.
- How to run any application from the Ease of Access button on the Windows 10 login screenthe ease of access button on the windows 10 login screen is designed to support, allowing users to access features that can access narrator, magnifier, high contrast mode, onscreen keyboard, sticky keys ... . when any incident occurs.
- How to add custom words to Voice Access Windows 11microsoft is introducing the ability to add your own words to the dictionary in voice access. adding your own words, including hard-to-pronounce words, to the dictionary in voice access will help improve speech accuracy.
- Unable to access 192.168.1.1: Cause and remedywhy can't i go to 192.168.1.1? it is a question that many people are interested in. to fix bugs that cannot be accessed 192.168.1.1, follow the instructions below.
- How to allow or block access to Microsoft Store in Windows 10microsoft store in windows 10 provides applications, games, music, movies, and so on. for users who buy or for free. if you don't like it, you can block access to the store according to the instructions in the following article.
- How to access BIOS on your Windows 11 PCaccessing the bios on a windows 11 pc can help you resolve a variety of system-related issues, as well as tweaking a wide range of settings that can have a significant impact on the user experience.