LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-27-2012, 06:48 AM   #1
muzaffar_muzu
LQ Newbie
 
Registered: May 2011
Posts: 17

Rep: Reputation: 0
rsh permission denied


i have configured rsh but it show permission denied, below are the configuration details.

[root@mindnic-06 ~]# 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
{
socket_type = stream
wait = no
user = root
log_on_success += USERID
log_on_failure += USERID
server = /usr/sbin/in.rshd
disable = no
}
[root@mindnic-06 ~]#

[root@mindnic-06 ~]# cat /etc/securetty
console
rsh
rlogin
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
rsync
rexec
[root@mindnic-06 ~]# cat /etc/hosts.equiv
+ +
[root@mindnic-06 ~]# cat /etc/pam.d/rsh
#%PAM-1.0
# For root login to succeed here with pam_securetty, "rsh" must be
# listed in /etc/securetty.
auth required pam_nologin.so
auth required pam_securetty.so
auth required pam_env.so
auth required pam_rhosts.so
account include password-auth
session optional pam_keyinit.so force revoke
session required pam_loginuid.so
session include password-auth
[root@mindnic-06 ~]# /etc/init.d/xinetd restart
Stopping xinetd: [ OK ]
Starting xinetd: [ OK ]
[root@mindnic-06 ~]# rsh localhost date
Permission denied.
[root@mindnic-06 ~]#


please help me to solve this Thanks in advance
 
Old 11-27-2012, 07:07 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Can I ask why you'd want to use rsh https://www.informit.com/articles/ar...p=169465&rll=1
 
Old 11-27-2012, 11:35 PM   #3
muzaffar_muzu
LQ Newbie
 
Registered: May 2011
Posts: 17

Original Poster
Rep: Reputation: 0
thanks for the reply, i agree with you. I am working in storage domain where we have to run the Automation and Manual Test Cases. so in Automation scipts we use rsh tool to remotely login to devices say client where it will login without password. we cant use ssh here, ssh cant login without password so i was in need of that, I was able to solve this issue, we have to disable all firewall and selinux related things and reboot the machine once


[root@mindnic-06 ~]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disable
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted


[root@mindnic-06 ~]# rsh localhost date
Wed Nov 28 10:48:39 IST 2012
[root@mindnic-06 ~]#

Last edited by muzaffar_muzu; 11-27-2012 at 11:37 PM.
 
Old 11-28-2012, 12:53 AM   #4
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
ssh can be made to work without a password http://www.snailbook.com/faq/publick...auth.auto.html
 
Old 11-28-2012, 02:40 AM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
What linosaurusroot said, plus disabling SELinux is a bad idea; its there for a reason.
 
Old 04-21-2016, 10:03 AM   #6
nlainus
LQ Newbie
 
Registered: Feb 2009
Location: Minneapolis
Distribution: RHEL 4 & 5
Posts: 12

Rep: Reputation: 0
To enable SSH in RHEL/CentOS

1. Ensure that rsh and rsh_server are installed (rpm –qa | grep rsh*). If they aren’t install them (make sure xinetd is installed as well)

2. After installing the rsh packages modify the /etc/xinetd.d/rsh file. Change Disabled = yes to Disabled = no

3. Modify the line in the /etc/pam.d/rsh so that it reads as follows:
required pam_rhosts_auth.so promiscuous

4. Add rsh to /etc/securetty

5. Also create or add the allowed hostnames to the ~/.rhosts file to add them to the list of allowed rsh hosts.
I added + + to my .rhosts and all works great from any host. I've run into problems when specifying a specific hostname so the plus space plus works best.

6. run the command service xinetd start

7 If running CentOS7 you have to run these commands
systemctl start rsh.socket
systemctl start rexec.socket
systemctl start rlogin.socket
systemctl enable rsh.socket
systemctl enable rexec.socket
systemctl enable rlogin.socket

Hope this helps. Works for me since I use pdsh all the time for managing my cluster.

Last edited by nlainus; 04-21-2016 at 10:09 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
rsh -l option permission denied error kgopal30 Linux - Server 1 09-28-2011 09:06 PM
permission denied using rsh (security not an issue) Singist Linux - Networking 1 04-04-2006 02:22 PM
rsh permission denied eozcan Linux - Security 2 12-07-2004 09:26 AM
Permission Denied on a RSH Connection Eluminator Linux - Software 4 11-08-2002 03:06 AM
rsh. Permission denied pedroem Linux - Networking 2 10-09-2002 02:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration