How to configure rsh, rcp, and scp on CentOS to connect multiple nodes without a password.

Source: Internet
Author: User
In CentOS5, a method for achieving password-less communication between two-host rlogin and rsh is ========================== ================================== author: cnhtm (http://cnhtm.itpub.net) Published on: 2010.01.1309: 23 classification: general classification Source: in http CentOS5, a method for achieving password-less communication between two-host rlogin and rsh is ==================== ==================================== author: cnhtm (http://cnhtm.itpub.net)
Posted at: 2010.01.13
Category: General Category
Source: http://cnhtm.itpub.net/post/39970/495882
---------------------------------------------------------------

When installing RAC, you need to configure the mutual trust between each node so that commands such as rsh, rlogin, and rcp do not need to enter a password to operate on other nodes.
In addition to configuring ssh according to the methods in the installation document of the administrator rac, you can also implement mutual trust by modifying files such as. rhosts.
In unix (such as aix), you can simply modify the/etc/hosts. equiv implementation, but it is troublesome in Linux and requires some other steps. the following shows the configuration method.

Perform the following operations on each node:


1. check whether the rsh-server package has been installed.

[Root @ rac1 ~] # Rpm-qa | grep-I ^ rsh-server
Rsh-server-0.17-40.el5

Run the rpm-ivh command

2. make sure that the line disable = no exists in/etc/xinetd. d/rlogin (red part)

[Root @ rac1 ~] # Cat/etc/xinetd. d/rlogin
# Default: on
# Description: rlogind is the server for the rlogin (1) program. The server
# Provides a remote login facility with authentication based on
# Privileged port numbers from trusted hosts.
Service login
{
Disable = no
Socket_type = stream
Wait = no
User = root
Log_on_success + = USERID
Log_on_failure + = USERID
Server =/usr/sbin/in. rlogind
}

3. make sure that the/etc/xinetd. d/rsh line disable = no exists (red part)

[Root @ rac1 ~] # Cat/etc/xinetd. d/rsh
# Default: on
# Description: The rshd server is the server for the rcmd (3) routine and,
# Consequently, for the rsh (1) program. The server provides
# Remote execution facilities with authentication based on
# Privileged port numbers from trusted hosts.
Service shell
{
Disable = no
Socket_type = stream
Wait = no
User = root
Log_on_success + = USERID
Log_on_failure + = USERID
Server =/usr/sbin/in. rshd
}

4. restart the xinetd service.

[Root @ rac1 ~] # Service xinetd restart
Stopping xinetd: [OK]
Starting xinetd: [OK]

5. edit/etc/securetty to ensure there are three lines (red part): rexec, rsh, and rlogin)

[Root @ rac1 ~] # Cat/etc/securetty
Console
Vc/1
Vc/2
Vc/3
Vc/4
Vc/5
Vc/6
Vc/7
Vc/8
Vc/9
Vc/10
Vc/11
Tty1
Tty2
Tty3
Tty4
Tty5
Tty6
Tty7
Tty8
Tty9
Tty10
Tty11
Rexec
Rsh
Rlogin

6. edit the/etc/hosts. equiv file as follows:

[Root @ rac1 ~] # Cat/etc/hosts. equiv
+ Rac1 oracle
+ Rac2 oracle
+ Rac1-priv oracle
+ Rac2-priv oracle
+ Rac1 root
+ Rac2 root
-Rac1-priv root
-Rac2-priv root

7. edit the/etc/hosts file as follows:

[Root @ rac1 ~] # Cat/etc/hosts
# Do not remove the following line, or various programs
# That require network functionality will fail.
127.0.0.1 localhost. localdomain localhost
: 1 localhost6.localdomain6 localhost6

# Public
192.168.2.101 rac1.localdomain rac1
192.168.2.102 rac2.localdomain rac2

# Private
192.168.0.101 rac1-priv.localdomain rac1-priv
192.168.0.102 rac2-priv.localdomain rac2-priv

# Virtual
192.168.2.111 rac1-vip.localdomain rac1-vip
192.168.2.112 rac2-vip.localdomain rac2-vip

8. edit ~ /. Rhosts, as shown below

[Root @ rac1 ~] # Cat ~ /. Rhosts
+ Rac1 root
+ Rac2 root
-Rac1-priv root
-Rac2-priv root

9. test whether rlogin and rsh can be used to log on to other nodes without a password.

[Root @ rac1 ~] # Rlogin rac2
Connect to address 192.168.2.102 port 543: Connection refused
Trying krb4 rlogin...
Connect to address 192.168.2.102 port 543: Connection refused
Trying normal rlogin (/usr/bin/rlogin)
Last login: Wed Jan 13 08:39:17 from rac1
[Root @ rac2 ~] # Hostname
Rac2.localdomain
[Root @ rac2 ~] # Exit
Logout
Rlogin: connection closed.
[Root @ rac1 ~] # Rsh rac2
Connect to address 192.168.2.102 port 543: Connection refused
Trying krb4 rlogin...
Connect to address 192.168.2.102 port 543: Connection refused
Trying normal rlogin (/usr/bin/rlogin)
Last login: Wed Jan 13 08:47:22 from rac1
[Root @ rac2 ~] # Hostname
Rac2.localdomain
[Root @ rac2 ~] # Exit
Logout
Rlogin: connection closed.

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.