Ssh password-free Login
Recently, I used rsync to process sync from the ssh channel. However, ssh requires a password pair to be used for rsync, and it is also placed into cron auto-dynamic lines, no one can find the password. It will cry ~
Secret generation using ssh-keygen id_rsa, id_rsa.pub$ Ssh-keygen-t rsa or ssh-
authorized_keys
[Root @ localhost. ssh] # ls
Authorized_keys known_hosts me. pub
[Root @ localhost. ssh] # cat authorized_keys
Ssh-rsa Secure/LZ00EZah8EjfZhqjAc/secure + secure/secure + Po4L1pbHLRf + TSoZ5RSBZZjY4/JMAzdXHNtnAyO0j0VNGbBXKUcNSAHZ
3. Configure Xshell to log on to the server using key authentication:
Open Xshell and click "New". The "New Session Properties" dialog box is displayed. In the "Connection" column, enter the IP address and port of the Public Key you Just configured,
as the configuration process requires frequentSSHConnect to the development server to execute commands andSCPcommand to copy files to the server such as dependenciesSSHthe operation of the connection. So, configure the local environment with the serverSSHPassword-free connection can effectively improve productivity. since I have already generated the public key, I just need to copy the existing public key to the server. Recommended UseSsh-copy-idcomma
Tags: ssh directory gen key cat did not create a public key download installationFirst detect if there is SSH1. If you do not have the download installed, you can create the. ssh folder in your home directorymkdir ~/.ssh2. Generate keySSH-KEYGEN-T RSA3. Write the current public key to the Authorized_keysCat Id-rsa.pub >> Authorized_keys4. After writing, copy the Authorized_keys to the next computer's ~/.ssh folder to overwrite5. Connect to the next computer write the public key of the next compu
Recently has been looking at how to create sudo user and free of sudo password, found a lot of information, the results found is not OK. And I cracked it today!Environment: CentOS 6.61. First you have a regular user who executes sudo.[Email protected] ~]# useradd Chengcai2. Log in as root, and then modify the/etc/sudoers file:Vim/etc/sudoers###################################################################
One, one-waySSH-KEYGEN-T RSAOne-way no password access remote server operation is relatively simple, such as Server A requires no password to access server B (a–>b), then only need to generate a key pair in Server A, Upload the generated public key to the. SSH directory in the relevant user directory of Server B (not manually created, note that its directory permissions are 700), and change the public key f
should copy Identity.pub as default.
The agent has no identities: When the ssh-agent is running and the ssh-add-l returns ' the agent has no identities ' (i.e no keys are added to the ssh-a Gent), the Ssh-copy-id would still copy the message "The agent has no identities" to the Remote-host ' s Authorized_keys entr Y.
Duplicate entry in Authorized_keys: I Wish Ssh-copy-id validates duplicate entry on the Remote-host ' s authorized_keys. If you execute Ssh-copy-id multiple times on the loca
Linux Basic tutorial Linux password-free ssh login SettingsBrother LianOverviewin some common devices ssh, SCP, do not enter the password can save a lot of time. Generate keySee if there is a local key, if there is, do not generate, otherwise it will affect the previous device.Copy the code code as follows :(brother even Linux training www.lampbrother.net)LS ~/.
In the automatic operation and maintenance platform is not finished, often need to log on to the server to do a lot of maintenance operations, every time to find a good long password, so many servers, you will be crazy, so blind to make the following script. First of all, haha.Cat Login_root.exp#!/usr/bin/expect -cset IP [lindex $argv 0]set PWD [lindex $argv 1]set timeout 2spawn ssh [emailprotected]$IPexpect "*yes/no*" {send "yes\r"}expect "*assword*"
Linuxssh password-free Login
Generate public keys and keys on the clientExecute
ssh-keygen -t rsa -P ''
Press enter to generate both the public key and the key.
Add the public key of the client to the public key file of the Server for authentication.The procedure is as follows:1. Copy the client Public Key to the Server
scp scp ~/.ssh/id_rsa.pub gino@172.16.60.134:~/.ssh/
2. Copy the public key content to t
Ssh password-free login-Establish a trust relationship with the server
Assume that the master machine A, B, and C needs to be established as the master machine A. You can directly access the master machine B and C through ssh without A password. The procedure is as follows:
Assume that you only use the user yimr to establish trust, use the yimr user to log on t
solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650; src=/e/ U261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/images/localimage.png") No-repeat center;border:1px solid #ddd; "alt=" Spacer.gif "/>Id_rsa the private key id_rsa.pub as the public keyCopy the public key to two other machinesNode36 Ssh-copy-id node40 Ssh-copy-id node44Node40 Ssh-copy-id node36 Ssh-copy-id node44Node44 Ssh-copy-id node36 Ssh-copy-id node40At this point directly specify any one machine
machine, such as getin (any character or string you want, but do not repeat the existing command name ):Alias getin = 'ssh [email protected]' In this way, after you restart and enter the machine alias to take effect, you can directly input the command getin. In this way, enter a few simple characters to enter the server. Likewise, you can use the following method to copy an object:SCP your_local_file [email protected]:/server_path /... /In this way, you do not need to connect to FTP. You can e
1) ssh-keygen-t rsa press ENTER
2) Prompt
"Your identification has been saved in/root/. Ssh/id_rsa.
Your public key has been saved in/root/. Ssh/id_rsa.pub.
The key fingerprint is:
A0: 28: 72: A7: CB: 65: 6C: 9d: 20: C9: 17: 96: 64: 2f: E7: 76 root @ beth1"
3) on the master node, copy the created public key to the file named authorized_keys:
CD./. SSH
CP id_rsa.pub authorized_keys
4) Run ssh-keygen on the master node.Program. After the directory structure of other sub-nodes is
Use ssh-keygen, implement password-free login to linux host 192.168.1.2 server 192.168.1.3 first generate key ssh-keygen-t rsa in the user directory of the local host and press four enter keys as prompted, the key to be used is generated. the generated file id_rsa.pub is displayed in the ssh/directory and uploaded to the root directory of the server. scp-p id_rsa.pub username@192.168.1.3 :. ssh/rename id_rs
In order to simplify the SSH process, the use of the certificate method, the SSH login to avoid the need to enter the account password process, the specific operation is as follows:One, on the machine where the SSH server1. Log in as root, change the SSH config file/etc/ssh/sshd_config, and remove the comments from the following configurationrsaauthentication Yes #启用rsa认证PubkeyAuthentication Yes #启用公钥私钥配对认证方式AuthorizedKeysFile. ssh/authorized_keys #公钥
Experimental background
In a local area network, in which the designation of a host as a management machine, other hosts as the management machine, for the convenience of maintenance later, requires the implementation of the management machine without password, direct login to be managed machine.
Use VMware Workstation to build an analog LAN
The local area network has four hosts, through the virtual Switch Vnet1, realizes the interconnection interw
To set up password-free SSH login:Example: to Node1 a virtual machine access node2 password-free1. First check to see if you can log in to SSH node2 (the/etc/hosts file is mapped to a good address)2. Generate secret keys (including public and private keys) and validation files$ ssh-keygen-t Dsa-p "-F ~/.SSH/ID_DSA$ cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys/
full description of SSH authentication:https://www.ibm.com/developerworks/cn/linux/security/openssh/part1/Description: Point me to checkToday we only say to generate SSH key, so as to achieve the purpose of password-free landing.Do not know what SSH is to look at the description. All right, no more nonsense.System: CentOS 5.8
Confirm UserConfirm that the current user is the user you need!$ whoamifroad
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.