Recently got a secondhand hp notebook. Sell my book is think very beautiful costume designer, she because have a new Mac Ben so HP was idle, then sold to me. The performance of the book is similar to my own Samsung, in addition to the battery is not too powerful, each boot will prompt 601.
I also have a wireless router. Both computers are fitted with ubuntu14.04 64-bit systems. So I want to open a LAN through the wireless router to SSH connection between the two computers.
First try ssh localhost
$ ssh localhostssh:connect to host localhost Port 22:connection refused
Running the following command generates a bunch of keys id_rsa and id_rsa.pub in the ~/.ssh/directory:
$ ssh-keygen
To enter the following prompt information, the key pair will be generated in the default location ~/.ssh/directory, and we set passphrase to empty, that is, no password login.
Use the following command to join the newly generated public key to the authorized key list file Authorized_keys (because there is no Authorized_keys file at the beginning, so use the CP command here):
$CP ~/.ssh/id_isa.pub ~/.ssh/authorized_keys
Make sure that the. SSH directory and the Authorized_keys file have only the user's own Write permission, otherwise the validation is not valid
$ CHOMD ~/.ssh/authorized_keys
$ chmod ~/.ssh
However, it is still not possible to SSH to localhost because Ubuntu does not have an SSH server installed and opened by default, so we also need to:
1. Determine the installation of sshd
$ sudo apt-get install Openssh-server
2. Start sshd
$ sudo net start sshd
3. Check the firewall settings and turn off the firewall
$ sudo nfw disable
4. Verify the success, run the following command
$ ssh localhost
Sometimes although successful, but still will appear connection refused problem, this is, need to check whether the sshd process is started.
Run the following command to see if there is an sshd process:
$ PS-E | grep ssh
Sometimes although you can see the sshd, but still cannot connect successfully, this is the need to restart SSH:
$ sudo service ssh restart
Then connect again.
Samsung computers and HP computers are connected to the LAN, the Samsung computer's intranet IP for the 192.168.1.101,HP computer's intranet IP is 192.168.1.102, add the contents of the id_rsa.pub of the Panjiang HP computer to the Samsung computer's Authorized_ In the keys, SSH to the Samsung computer using the following command on the HP computer:
$ ssh 192.168.1.101
Use Ctrl+d or exit or logout to exit the SSH connection.
An attempt to ssh the connection in the LAN