Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using RCP Command

Status
Not open for further replies.

KOG

MIS
Jan 31, 2002
303
GB
Hi Folks,

I am trying to create a scheduled script where I create a dump file overnight and run the rcp command to transfer it from one server to another.

Testing it on 43P to another server for development use only, I ran it using root and for some reason I have been denied access?

# rcp dan_test.txt blbrs580:/home/dan_test.txt
rshd: 0826-813 Permission is denied.

Can anyone explain why?

I have updated the hostname and IP address for both servers on both /etc/hosts file.

Is there anything I should do before running rcp command?

Thanking you all in advance.

Regards

Katherine
 
Hi PSD

Eib-srv0 Outputs

As a root user

# ls -l .rhosts
-rw------- 1 root system 12 06 Feb 11:32 .rhosts
# cat .rhosts
blbrs580
# pwd
/

As an oracle user

# su - oracle
$ pwd
/home/oracle
$ hostname
eib-srv0
$ ls -la .rhosts
-rw------- 1 oracle oinstall 9 06 Feb 11:30 .rhosts
$ cat .rhosts
blbrs580

$ grep "rshd" /etc/inetd.conf
shell stream tcp6 nowait root /usr/sbin/rshd rshd
kshell stream tcp nowait root /usr/sbin/krshd krshd
$

End ouputs of /etc/hosts

127.0.0.1 loopback localhost
130.1.103.3 blbrs580
130.1.103.2 eib-srv0

# Internet Address Hostname # Comments
# 192.9.200.1 net0sample # ethernet name/address

blbrs580 Outputs

As a root user

# ls -la .rhosts
-rw------- 1 root system 12 06 Feb 05:34 .rhosts
# cat .rhosts
eib-srv0
# pwd
/

As an oracle user

# su - oracle
$ pwd
/home/oracle
$ hostname
blbrs580
$ ls -la .rhosts
-rw------- 1 oracle oinstall 9 06 Feb 05:40 .rhosts
$ cat .rhosts
eib-srv0
$

$ grep "rshd" /etc/inetd.conf
shell stream tcp6 nowait root /usr/sbin/rshd rshd
kshell stream tcp nowait root /usr/sbin/krshd krshd
$

End outputs of /etc/hosts

# Internet Address Hostname # Comments
# 192.9.200.1 net0sample # ethernet name/address
# 128.100.0.1 token0sample # token ring name/address
# 10.2.0.2 x25sample # x.25 name/address
127.0.0.1 loopback localhost # loopback (lo0) name/address
130.1.103.3 blbrs580
130.1.103.2 eib-srv0

Cheers

Katherine
 
Katherine,

That all looks good, what is in the /etc/hosts.equiv file? PSD
IBM Certified Specialist - AIX V4.3 Systems Support
IBM Certified Specialist - AIX V4 HACMP
 
Hi PSD

There is nothing in both servers for /etc/hosts.equiv just comments, should I put something in this file?

To be honest, I do not know the purpose of this film only hosts.

Cheers

Katherine
 
Hi Katherine,

The /etc/hosts.equiv file is where you can define other systems that will be allowed to execute commands without supplying a password. It's also worth noting that there is no encryption over this connection either. As such, it can be a very dangerous thing to do if the system in question is connected to the internet.

This page gives a pretty good overview of the whole 'r-commands' setup, I hope it helps a bit.


If you're going to be doing much with AIX, you might want to take a look at this page (if you haven't already):


That entire site is a treasure-trove if you're wanting to do things on an AIX site, IMHO. I hope this helps you.

Good luck!

T.
 
Hi,

What I do is temporarly adding /etc/resolv.conf (defines DNS) for the remote command execution duration,then later remove it,both from the script.This seems to enable running the rsh and rcp:
==========================
AT the beginning:

#Check if the DNS is enabled on the host
rsh $STATION_NAME -l sciroot ls / >/dev/null 2>&1
if [[ $? != 0 ]] ;then
#Enable DNS on the destination host
cd /etc
ftp -nv <<!
open $STATION_NAME
user root ripro
cd /etc
put resolv.conf
!
DNS=”NO”
fi


After:

#Disable back DNS on the destination host
rsh $STATION_NAME -l sciroot rm /etc/resolv.conf
fi
&quot;Long live king Moshiach !&quot;
 
Hi,

It has probable been checked before, but what do you have in &quot;User can LOGIN REMOTELY&quot; field (smitty user) ? It should be set to &quot;true&quot;
 
just throwing this out: make sure forward and reverse name resolution is working. it seems to be since you say you can rcp as root, but it might be worth a look. if you telnet from one host to another as oracle, a who command will show you where it thinks you are coming from, and your .rhosts entries should match those hostnames. IBM Certified -- AIX 4.3 Obfuscation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top