In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
The following commands are all server-side operations unless they are bolded to indicate that they operate on the local computer
1 Install and log in remotely using ssh
Update software list
sudo apt-get update
Update local software
sudo apt-get upgrade
Install ssh service
sudo apt-get install openssh-server
Start ssh service
sudo /etc/init.d/ssh start
View local IP address
After the inet field is your IP address.
sudo ifconfig
remote login
Enter ssh @ in the local computer terminal
Here we assume that the username and IP address on the server are xiaoming and 192.168.1.1. Please replace them with your own automatically. I will not repeat them later.
ssh xiaoming@192.168.1.1
2 Set Remote Login Shortcuts
It is troublesome to enter the username and password every time you log in to the server, and the IP address is not easy to remember, so you can modify the.bashrc file to set the quick key for remote login.
Open the.bashrc configuration file using an editor on your local computer
sudo vi ~/.bashrc
Add the following at the end
alias server='ssh xiaoming@192.168.1.1'
Close the file and reload the configuration file by entering the following command on the command line
source ~/.bashrc
After entering server in the terminal, you can log in to the server remotely
3 Add public key authentication
Entering the password of the server every time you log in is cumbersome and not very secure. At this time, you can add public key authentication to avoid the trouble of entering passwords and improve security.
3.1 generate the key pair
Enter the following command on your local computer
ssh-keygen
will prompt you
Generating public/private rsa key pair.Enter file in which to save the key (/home/python/.ssh/id_rsa):
Enter directly to confirm
Next, the system will prompt you to set a password to ensure the security of the key. Generally, enter directly to confirm that the password is blank. In this way, you can avoid the trouble of entering the password when using the private key authentication.
Switch to Key Pair Directory
cd ~/.ssh/
At this point, you can see the generated private key id_rsa and public key id_rsa.pub in the ~/.ssh directory. Remember not to expose your private key id_rsa under any circumstances.
3.2 Copy public key to remote server
Enter the following command on your local computer
ssh-copy-id xiaoming@192.168.1.1
3.3 Done!
After completing the above configuration, you can type the following command from your local computer to ssh remotely log on to your server
server
The above is all the content of this article, I hope to help everyone's study, but also hope that everyone a lot of support.
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.