How to connect PuTTY to FreeBSD under VMware

Source: Internet
Author: User

PuTTY connected to FreeBSD under VMware two months ago, I installed a FreeBSD system under the vmwarevm. After the installation, I did not care about it any more. Today, I suddenly want to play with this FreeBSD and see what kind of system it is. To be honest, I am not used to using FreeBSD for the first time. Because FreeBSD is different from other similar ubuntu or Centos, the command prompt has changed and there is only one "#". I was wondering, how do I know who the current user is? Are you sure you want to use the who command? I will not discuss the user's problem first, because I have not studied that place. Because the system must be operated under the virtual machine, the mouse must be placed in the form of the virtual machine, you must press "Alt + Ctrl" to release the mouse out of the host. So I decided to directly connect to FreeBSD using PuTTY on the host and directly use PuTTY as the terminal operating system.
My environment here is: home broadband adsl dial-up Internet, there is a TP-LINK router, connected to three hosts, forming a simple home LAN, the network segment is 192.168.1.0. My VMware is on one of the hosts. FreeBSD's network connection method is NAT (it can also be Bridge, which is different from that in school ). Www.2cto.com first, to connect to the system, you must know the Virtual Machine IP address. I first log on to the system from the virtual machine and run the "ifconfig" command to view the IP address. But it is strange that I cannot see the ipv4 address in the result. I suspect that the system has not obtained the IP address, so I tried to ping www.baidu.com, and the result was not responded. I think there should be no IP address. Baidu used the IP Address Setting Method in FreeBSD. It turns out that I didn't set the system's "DHCP" to automatically get the IP address. Find the cause and solve the problem: Enter the command [cpp] # ee/etc/rc in the command line. conf shows an interface similar to the text editor. At this time, we add the following statement to the first line: [cpp] ifconfig_le0 = "DHCP" and the le0 above is the name of the NIC. You can use ifconfig-a to view the name of a valid ENI. After the modification is complete, press "Esc + Enter". The system prompts two options (A, save to change. B, no save.) and select save to change to save the modification. Www.2cto.com
After saving the configuration, enter "sh/etc/rc" in the command line to make the modification take effect. Enter "ifconfig" and you will see that the virtual machine installed with FreeBSD has obtained a normal ipv4 address. Of course, you can also manually set the IP address under FreeBSD. I will not detail it here. Please use Baidu Google. Next, I tried to use PuTTY to connect, enter the IP address, and click Connect. the following error occurs:

Based on my experience, my response was probably that the sshd service was not enabled on the virtual machine, or the sshd service encountered a problem. Therefore, I entered the "service sshd restart" command to restart the sshd service. However, this command reports an error. It seems that there is no "restart" command in FreeBSD and "onerestart" is used, so I tried to enter "service sshd onerestart ", the command line prompts that the sshd command has been started. So I tried to connect again, and the effect was good. The login interface has already appeared, as shown below (because this system does not create other users, so I can only log in as root): www.2cto.com

After the password is entered, I thought the connection was normal, but an access denial error was reported, as shown below:

No way, this error has never been seen before, so I have to ask Baidu Google for help. It turns out that FreeBSD uses keyboard-interactive authentication by default, that is, the keyboard interaction authentication mode. That is to say, the user must enter the password on the keyboard to log on to the system interface to pass authentication. If the authentication is performed through remote logon, the authentication fails. If you need to remotely ssh to the system, you must use password authentication, that is, password authentication. In this case, you need to modify the ssh configuration file/etc/ssh/sshd_config (by default, all content in this file is commented out ):
Remove the # PasswordAuthentication no clause, and then change "no" to "yes"; remove the # PermitRootLogin = no clause, change "no" to "yes", and restart the sshd service "service sshd onerestart ". After the above steps, I tried again and entered the account and password, and finally the connection was successful (FreeBSD's welcome speech is so much !!) :

At this point, it basically solves the common problems of PuTTY connecting to the FreeBSD host. Prepared by AI_Net

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.