In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
SSH here, the full name is Security Shell, I believe that students who often use Linux will be no stranger. The most common function of SSH is to remotely log in to the command line interface of other systems, of course, mainly for Linux users. However, its implementation already comes with OpenSSH functionality in Windows 10, so we can install and use SSH-related functions under Windows. Let's see how to install it.
View system version
First determine if your system is Windows 10 1809 or newer, and if not, update the system to the latest state.
View the system version is also very easy, open the start menu, select Settings, and then select system-> about, you can find the system version number at the bottom.
Or, if you like the command line, you can run the following command from powershell to check the version number.
(Get-ItemProperty "HKLM:\ SOFTWARE\ Microsoft\ Windows NT\ CurrentVersion") .ReleaseId
Install OpenSSH
After determining the version number, let's install OpenSSH. The installation method is also very simple, or from the start menu to enter the Windows settings, this time select Application-> applications and Features-> optional applications-> add functions to enter.
Then go to the OpenSSH server and client, and install them.
If you prefer a simple command line, just as simple, run the following command to check out the OpenSSH function.
# check the software Get-WindowsCapability-Online first |? Name-like 'OpenSSH*'# should show the following output. Note that the version number may change in the future. Pay attention to Name: OpenSSH.Client~~~~0.0.1.0State: NotPresentName: OpenSSH.Server~~~~0.0.1.0State: NotPresent when installing.
Then install them.
# install client Add-WindowsCapability-Online-Name OpenSSH.Client~~~~0.0.1.0# install server Add-WindowsCapability-Online-Name OpenSSH.Server~~~~0.0.1.0# their output should be similar to the following Path: Online: TrueRestartNeeded: False
The result is exactly the same as the graphical interface installation. Either way, you now have the OpenSSH function.
Start the SSH server
Next, open the powershell window with administrator privileges. This time, enter the following command to view the OpenSSH service that has just been installed. The sshd below is the server side of OpenSSH.
Get-Service * | where Name- Like'* ssh*'Status Name DisplayName- Stopped ssh-agent OpenSSH Authentication AgentStopped sshd OpenSSH SSH Server
Simply start the service.
Start-Service sshd
Now you can use the client of OpenSSH to connect, just enter the following command in the powershell window (no administrator is required). It needs to be reminded here that if you use a Microsoft account (that is, Microsoft mailbox) to create and log in to users, the user name will be truncated to the front of the @ symbol, specifically the name of your user folder. This is also a bit of a trick for Microsoft to do.
Ssh your user name @ localhost
Then you should see a change in the command prompt, indicating that you are now in the SSH environment. Although this environment is still your local machine. If you run commands in this environment, you should also find that this is a cmd window, not a powershell terminal window.
Use SFTP instead of FTP
Well, you may have a problem here, although we succeeded in getting the OpenSSH server running on Windows, but what's the use of it? This is a good question, frankly speaking, it is really useless, but by comparison, it is the perfect replacement for FTP.
FTP should be used frequently. I used to like to open an IIS server on Windows and use it to create a FTP server to transfer files. I'm sure a lot of people will use it this way. But FTP as an old protocol, the biggest problem is that there is no encryption, all traffic is public transmission, it is easy to intercept and read. At this point, it's best to use SFTP instead. Although its name is very similar, it has nothing to do with FTP, because SFTP is based on the SSH protocol just introduced.
So how do you use SFTP? In fact, it is very simple. The OpenSSH server we just built comes with SFTP support, so now we have built the SFTP. The usage is simple. Open the FTP client software such as FileZilla or WinSCP, open the drop-down list of protocols, and you can see the option SFTP. With just a click of the mouse, we can get a secure, encrypted and efficient transport protocol!
In addition, if you are a Linux user, do not install FTP servers such as vsftpd on Linux, which is also insecure and unnecessary. Directly use your SSH login Linux user name and password, randomly find any FTP client software (basically support the SFTP protocol), login can.
So far, this is the end of this article on a few steps to easily build a Windows SSH server. For more information about building a Windows SSH server, please search for previous articles or continue to browse the following related articles. I hope you will support it in the future!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.