SSH between two linux servers without password
SSH between two linux servers without password
SSh between two linux servers without password
There are lot of requirements in the production environment [Linux/Unix/AIX] where there is a need to have SSH without password prompt from one server to another under some id’s. But how to do that. Here is the solution and tips on how to approach this method without any bugs.
First of all lets take 2 servers
SERVER A and SERVER B
Here my requirement is to make some script which is in SERVER A copy some files from SERVER B and do some data updating activity in SERVER A.
STEP 1
Switch to the ID where you need the process to be running. [MAKE SURE THAT YOU HAVE HOME DIRECTORY SET FOR THE RESPECTIVE ID ON BOTH THE SERVERS]
Generate SSH keys in SERVER A.
ssh-keygen -t rsa
This will create PUBLIC KEY with an extension .PUB and another key which is the PRIVATE KEY inside the
/home/YOUR_ID/.ssh directory.
STEP 2
Now Login to SERVER B and CHANGE DIRECTORY [cd command] to the home directory of the same id. Then copy the content of the PUBLIC KEY that was created in to a file named authorized_keys with command
cat <filename>.PUB >> authorized_keys
YOU ARE SET NOW 🙂
Logout of SERVER B and LOGIN WITH THE SAME ID ON SERVER A
Issue command
ssh SERVER B
This will take you to SERVER B without any password prompt.
NOTE
Make sure the home directory permission
/home/YOUR_ID This should be 755
The other files like PRIVATE AND PUBLIC KEYS and also the AUTHORIZED_KEYS should have only 600 permission. THIS IS A MUST OTHERWISE IT WONT WORK.
Incoming search terms:
- how to login from one server to another aix server (4)
- aix block login to another server (1)
- linux aix ssh (1)
- logon using ssh without any prompt in aix server (1)
- passing data between servers shell script (1)
- script for connecting one aix server to another aix server (1)
- ssh between linux and aix (1)
- ssh from one AIX server to anotehr (1)
- ssh from solaris to new aix server (1)
- ssh in unix servers without password using cgi scripting (1)
- ssh passwordless from aix to centos (1)
- ssh to another aix server without password (1)
- unix file transfer between servers without password (1)
- inurl:wp/wp-login php (1)
- how to view files from one server to another server in putty (1)
- aix pass parameters to php another server (1)
- apache ssh another server (1)
- change from one server to another in linux (1)
- copy files from one server to another without password prompt (1)
- file transfer from one environment to other unix without password (1)
- how to aix ssh no password (1)
- how to change one server to another ssh in aix (1)
- how to login to another server from putty aix (1)
- how to login without passwd from other server in AIX (1)
- how to switch from one server to another in unix (1)
- how to switch from one server to another server in unix using shell scripts (1)
- unix script to ssh from 1 server to another server (1)