Monday, April 16, 2012

Configure rsh for CentOS
1. check if rsh-server is installed:
[root@rac1 ~]# rpm -qa|grep -i ^rsh-server

2. make sure no disable = no in /etc/xinetd.d/rlogin  :

1.  [root@rac1 ~]# cat /etc/xinetd.d/rlogin  
2.  # default: on  
3.  # description: rlogind is the server for the rlogin(1) program. The server  
4.  # provides a remote login facility with authentication based on  
5.  # privileged port numbers from trusted hosts.  
6.  service login  
7.  {disable = no 
8.  socket_type = stream 
9.  wait = no 
10. user = root 
11. log_on_success += USERID  
12. log_on_failure += USERID  
13. server = /usr/sbin/in.rlogind} 



3. make sure no disable = no in /etc/xinetd.d/rsh  : 

1.  [root@rac1 ~]# cat /etc/xinetd.d/rsh  
2.  # default: on  
3.  # description: The rshd server is the server for the rcmd(3) routine and,  
4.  # consequently, for the rsh(1) program. The server provides  
5.  # remote execution facilities with authentication based on  
6.  # privileged port numbers from trusted hosts.  
7.  service shell  
8.  {  
9.  disable = no 
10. socket_type = stream 
11. wait = no 
12. user = root 
13. log_on_success += USERID  
14. log_on_failure += USERID  
15. server = /usr/sbin/in.rshd  
16. }  
17.  

4. restart xinetd service:

[root@rac1 ~]# service xinetd restart
       Stopping xinetd: [ OK ]
       Starting xinetd: [ OK ]
 5. make sure rexecrshrlogin exists in /etc/securetty :
 
1.  [root@rac1 ~]# cat /etc/securetty  
2.  console  
3.  vc/1  
4.  vc/2  
5.  vc/3  
6.  vc/4  
7.  vc/5  
8.  vc/6  
9.  vc/7  
10. vc/8  
11. vc/9  
12. vc/10  
13. vc/11  
14. tty1  
15. tty2  
16. tty3  
17. tty4  
18. tty5  
19. tty6  
20. tty7  
21. tty8  
22. tty9  
23. tty10  
24. tty11  
25. rexec  
26. rsh  
      27. rlogin 
6. modify /etc/hosts.equiv:

1.  [root@rac1 ~]# cat /etc/hosts.equiv  
2.  +rac1 oracle  
3.  +rac2 oracle  
4.  +rac1-priv oracle  
5.  +rac2-priv oracle  
6.  +rac1 root  
7.  +rac2 root  
8.  +rac1-priv root  
9.  +rac2-priv root  
  7. modify /etc/hosts  :

1.
1.  [root@rac1 ~]# cat /etc/hosts  
2.  # Do not remove the following line, or various programs  
3.  # that require network functionality will fail.  
4.  127.0.0.1 localhost.localdomain localhost  
5.  ::1 localhost6.localdomain6 localhost6  
6.   
7.  #public  
8.  192.168.2.101 rac1.localdomain rac1  
9.  192.168.2.102 rac2.localdomain rac2  
10.  
11. #private  
12. 192.168.0.101 rac1-priv.localdomain rac1-priv  
13. 192.168.0.102 rac2-priv.localdomain rac2-priv  
14.  
15. #virtual  
16. 192.168.2.111 rac1-vip.localdomain rac1-vip  
17. 192.168.2.112 rac2-vip.localdomain rac2-vip  

8. modify ~/.rhosts:

[root@rac1 ~]# cat ~/.rhosts
      +rac1 root
      +rac2 root
      +rac1-priv root
      +rac2-priv root
 9.test rlogin and rsh to nodes without passwords:

1.  [root@rac1 ~]# rlogin rac2  
2.  connect to address 192.168.2.102 port 543: Connection refused  
3.  Trying krb4 rlogin...  
4.  connect to address 192.168.2.102 port 543: Connection refused  
5.  trying normal rlogin (/usr/bin/rlogin)  
6.  Last login: Wed Jan 13 08:39:17 from rac1  
7.  [root@rac2 ~]# hostname  
8.  rac2.localdomain  
9.  [root@rac2 ~]# exit  
10. logout  
11. rlogin: connection closed.  
12. [root@rac1 ~]# rsh rac2  
13. connect to address 192.168.2.102 port 543: Connection refused  
14. Trying krb4 rlogin...  
15. connect to address 192.168.2.102 port 543: Connection refused  
16. trying normal rlogin (/usr/bin/rlogin)  
17. Last login: Wed Jan 13 08:47:22 from rac1  
18. [root@rac2 ~]# hostname  
19. rac2.localdomain  
20. [root@rac2 ~]# exit  
21. logout  
22. rlogin: connection closed.  
23.  

Done. 


 

No comments:

Post a Comment