Records of using ssh commands on Windows 8

Records of using ssh commands on Windows 8

1. Open the virtual machine and git bash window and prepare to connect

2. Enter ifconfig -a in the virtual machine to view the virtual machine IP

Find the IP address from the picture: inet address: 192.168.78.133

3. Enter the command: ssh [email protected] -p 22 to connect to the virtual machine

At this time, my computer reported an error: ssh: connect to host 192.168.78.133 port 22: Connection refused

This error may be caused by ssh-server not being installed or not being started. Ubuntu 11.10 installs openssh-client by default, but does not install server

Run ps -e | grep ssh to check whether there is an sshd process.

If not, it means the server is not started. Start the server process through /etc/init.d/ssh -start . If it prompts that ssh does not exist, then the server is not installed.

sudo apt-get install openssh-server

4. After installation, start the server service

5. At this time, use ssh [email protected] -p 22 to connect to the virtual machine again.

However, I did not set a password and do not know the password, so using the virtual machine password is useless.

At this point we can only modify the ssh configuration file to modify

Change PermitRootLogin prohibit-password in the /etc/ssh/sshd_config file PermitRootLogin yes (or delete PermitRootLogin prohibit-password. For safety, you can back it up and comment it out.)

View file permissions when modifying

At this point, you can see that the file has been changed to a normal file with permissions of rw-r--r--

To modify the file we can change the file to rwxrwxrwx

Execute the command: sudo chmod 777 /etc/ssh/sshd_config

Check permissions again

Use vim to modify the configuration: vim /etc/ssh/sshd_config

After modification, change the permissions back: sudo chmod 644/etc/ssh/sshd_config

sudo /etc/init.d/ssh restart restart

At this point, the password has been changed to the root user's password, but we still don't know the password

The default root password of Ubuntu is random, that is, there is a new root password every time you boot the computer. We can enter the command sudo passwd in the terminal, then enter the current user's password, enter,

The terminal will prompt us to enter a new password and confirm it. The password at this time is the new root password. After the modification is successful, enter the command su root and then enter the new password.

There is no default analysis because you haven't set a password for root. The first user is in the admin group, so he can set a password for root, so
sudo passwd root
[sudo] password for you: ---> Enter your password, it will not be displayed

Enter new UNIX password:

--- > Set root password
Retype new UNIX password:

Now just log in using the password you set.

Login successful, everything is ok

Summarize

The above is the record of using ssh command on window8 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • How to use ssh and scp through secret keys in Windows
  • Install OpenSSH on Windows and log in to the Linux server by generating an SSH key
  • SSH Server Configuration on Windows Graphic Tutorial
  • How to set up OpenSSH server in Windows 7
  • How to monitor Windows via ssh-powershell using Python
  • Tutorial on installing Python SSH module under Windows system
  • Tutorial on installing PHP-SSH2 extension in Windows 7

<<:  Detailed explanation of concat related functions in MySQL

>>:  WeChat Mini Program Basic Tutorial: Use of Echart

Recommend

A brief introduction to MySQL database optimization techniques

A mature database architecture is not designed wi...

How to configure mysql5.6 to support IPV6 connection in Linux environment

Introduction: This article mainly introduces how ...

MySQL Basics Quick Start Knowledge Summary (with Mind Map)

Table of contents Preface 1. Basic knowledge of d...

Solution to the problem of MySQL deleting and inserting data very slowly

When a company developer executes an insert state...

How to set background color and transparency in Vue

Background color and transparency settings As sho...

How to use React slots

Table of contents need Core Idea Two ways to impl...

Example of implementing dynamic verification code on a page using JavaScript

introduction: Nowadays, many dynamic verification...

Detailed explanation of software configuration using docker-compose in linux

Preface This article will share some docker-compo...

Web page creation question: Image file path

This article is original by 123WORDPRESS.COM Ligh...

CSS method of clearing float and BFC

BFC BFC: Block Formatting Context BFC layout rule...

Basic usage of wget command under Linux

Table of contents Preface 1. Download a single fi...

Commonly used js function methods in the front end

Table of contents 1. Email 2. Mobile phone number...

How to create a view on multiple tables in MySQL

In MySQL, create a view on two or more base table...