Topic
  • 12 replies
  • Latest Post - ‏2011-01-06T18:55:06Z by SystemAdmin
SystemAdmin
SystemAdmin
6902 Posts

Pinned topic RCP error in AIX

‏2010-12-30T00:45:09Z |
I have a number of machines on various versions of AIX (5.3 TL6, TL7, and 6.1). RCP used to work from other AIX, Linux and Windows machines to all of them. (Note: our logins, DNS, etc... are all managed through a Windows server.)

Recently, I made changes to the /etc/netsvc.conf and /etc/auto_master to get automounting working on these machines, which is now chugging along just fine. (Added hosts=local,bind in netsvc.conf.) However, that seems to have broken RCP. I know it's not anything with the .rhosts file, as it went from working for all users to working for none.

From Linux, I get the error "rshd: 0826-826 The host name for your address is not known". However, I can rsh just fine, and nslookup works perfectly.

From Windows, I'm getting "0826-813 Permission is denied" for both rcp and rsh.

From AIX, I was getting the error "rshd: 0826-813 Permission is denied", but then I changed my .rhosts file to have the FQDN of the machines rather than just the hostname, and now it works on the TL6 machine, but on the newer OSs I'm getting the error "shell-init: error retrieving current directory: getcwd: cannot access parent directories: A specified file does not support the ioctl system call."

(RCP still works fine to all Linux machines from all three platforms.)

I'm assuming this is something to do with resolution, given the changes when I put in FQDN names, and the fact it broke when I changed netsvc.conf, but I'm stumped as to what to do next. Does anyone have any ideas?
Updated on 2011-01-06T18:55:06Z at 2011-01-06T18:55:06Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    6902 Posts

    Re: RCP error in AIX

    ‏2010-12-30T00:50:53Z  
    Also, to forestall the inevitable "you shouldn't use RCP" - the network in question is fully enclosed (no external access whatsoever), and no sensitive information is kept on it. Some of my developers like to use RCP because it's easy to put in scripts for their file transfers and they don't have to mess around with permissions afterwards when transferring from Windows to AIX. If someone has an alternative that meets the same requirements, I'm happy to listen. :-)
  • mmveiga
    mmveiga
    78 Posts

    Re: RCP error in AIX

    ‏2010-12-30T16:26:28Z  
    I believe the right syntax for the /etc/netsvc.conf should be hosts=local,bind4, but I don't believe that is your problem.

    Did you try to nslookup the IP address of the client connecting to your RCP server to see what it resolves too ? My guess is that will be the full qualified domain name.

    You may also want to post more details, contents of /etc/resolv.conf and /etc/hosts from both client and server.

    On your second post you asked for suggestions to replace RCP, SSH (using SCP) is mine.

    Regards,
    Marcelo.
  • garethr
    garethr
    12 Posts

    Re: RCP error in AIX

    ‏2010-12-30T16:46:44Z  
    These errors look like file permission issues.

    On the "getcwd" one: Can the user that you're trying to rsh as actually cd to its home directory all the way from / ? I.e. without going through any directory owned by root and rwx------ or something.

    Are the permissions (as opposed to the content) of your configuration files correct?
  • SystemAdmin
    SystemAdmin
    6902 Posts

    Re: RCP error in AIX

    ‏2010-12-30T22:04:50Z  
    • mmveiga
    • ‏2010-12-30T16:26:28Z
    I believe the right syntax for the /etc/netsvc.conf should be hosts=local,bind4, but I don't believe that is your problem.

    Did you try to nslookup the IP address of the client connecting to your RCP server to see what it resolves too ? My guess is that will be the full qualified domain name.

    You may also want to post more details, contents of /etc/resolv.conf and /etc/hosts from both client and server.

    On your second post you asked for suggestions to replace RCP, SSH (using SCP) is mine.

    Regards,
    Marcelo.
    "On your second post you asked for suggestions to replace RCP, SSH (using SCP) is mine. "

    In order to do this in a script, without hardcoding a password, would something have to be set up with keys on both ends? The developer would like to be able to do this from any machine just by putting that machine in his rhosts file, nothing more complicated than that...(We also don't have any SSH even set up on the server, since it's a completely protected zone, but something could be done if needed.)
  • SystemAdmin
    SystemAdmin
    6902 Posts

    Re: RCP error in AIX

    ‏2010-12-30T22:08:12Z  
    • mmveiga
    • ‏2010-12-30T16:26:28Z
    I believe the right syntax for the /etc/netsvc.conf should be hosts=local,bind4, but I don't believe that is your problem.

    Did you try to nslookup the IP address of the client connecting to your RCP server to see what it resolves too ? My guess is that will be the full qualified domain name.

    You may also want to post more details, contents of /etc/resolv.conf and /etc/hosts from both client and server.

    On your second post you asked for suggestions to replace RCP, SSH (using SCP) is mine.

    Regards,
    Marcelo.
    "You may also want to post more details, contents of /etc/resolv.conf and /etc/hosts from both client and server."

    On the server, resolv.conf just has the nameserver address, and the domain name. /etc/hosts actually did have some hard coded entries, which I've now removed (the server didn't use to have the netsvc.conf set up to use bind, so I guess things were hard coded in a few places). I'm wondering if it was some sort of conflict here that was causing the problem - I'm going to remove those when I get the chance (the machine's in use currently) and see if that makes a difference.

    As for the client, the developer is mostly trying to do this from Windows machines, so those files do not exist.
  • SystemAdmin
    SystemAdmin
    6902 Posts

    Re: RCP error in AIX

    ‏2010-12-30T22:11:49Z  
    • garethr
    • ‏2010-12-30T16:46:44Z
    These errors look like file permission issues.

    On the "getcwd" one: Can the user that you're trying to rsh as actually cd to its home directory all the way from / ? I.e. without going through any directory owned by root and rwx------ or something.

    Are the permissions (as opposed to the content) of your configuration files correct?
    "On the "getcwd" one: Can the user that you're trying to rsh as actually cd to its home directory all the way from / ? I.e. without going through any directory owned by root and rwx------ or something."

    Yes, and these have not changed since things were working.

    "Are the permissions (as opposed to the content) of your configuration files correct?"

    By this, do you mean the .rhosts file, or something else? The .rhosts is 600, and again hasn't changed since things were working...
  • garethr
    garethr
    12 Posts

    Re: RCP error in AIX

    ‏2010-12-31T09:56:47Z  
    "On the "getcwd" one: Can the user that you're trying to rsh as actually cd to its home directory all the way from / ? I.e. without going through any directory owned by root and rwx------ or something."

    Yes, and these have not changed since things were working.

    "Are the permissions (as opposed to the content) of your configuration files correct?"

    By this, do you mean the .rhosts file, or something else? The .rhosts is 600, and again hasn't changed since things were working...
    Perhaps you should try using strace to run the rcp process, and watch the output for the error messages. When an error message appears, look back over the previous few kernel calls and you'll probably see a line showing a file "open" call which will return with an error. This might lead you to more insights.
  • SystemAdmin
    SystemAdmin
    6902 Posts

    Re: RCP error in AIX

    ‏2010-12-31T19:37:36Z  
    • garethr
    • ‏2010-12-31T09:56:47Z
    Perhaps you should try using strace to run the rcp process, and watch the output for the error messages. When an error message appears, look back over the previous few kernel calls and you'll probably see a line showing a file "open" call which will return with an error. This might lead you to more insights.
    Hmmm...I don't appear to have strace installed. I'll track it down and go from there. (Although of course that doesn't apply to testing from the Windows machine, but hopefully the errors are the same...)
  • SystemAdmin
    SystemAdmin
    6902 Posts

    Re: RCP error in AIX

    ‏2010-12-31T20:25:37Z  
    • garethr
    • ‏2010-12-31T09:56:47Z
    Perhaps you should try using strace to run the rcp process, and watch the output for the error messages. When an error message appears, look back over the previous few kernel calls and you'll probably see a line showing a file "open" call which will return with an error. This might lead you to more insights.
    Okay, I found one of our Linux machines with strace. Oddly, the error I get when I run rcp with strace (like even just the normal error on running the command, not the strace output) is different than the one I get when running it without. Does strace cause it to run differently?
  • mmveiga
    mmveiga
    78 Posts

    Re: RCP error in AIX

    ‏2010-12-31T21:01:59Z  
    "On your second post you asked for suggestions to replace RCP, SSH (using SCP) is mine. "

    In order to do this in a script, without hardcoding a password, would something have to be set up with keys on both ends? The developer would like to be able to do this from any machine just by putting that machine in his rhosts file, nothing more complicated than that...(We also don't have any SSH even set up on the server, since it's a completely protected zone, but something could be done if needed.)
    You can use files or key for authentication without passwords, key is better.
    A good resource is : http://www.openbsd.org/cgi-bin/man.cgi?query=ssh&sektion=1#AUTHENTICATION and the following page has information specific to AIX : http://www.ibm.com/developerworks/systems/articles/openssh_aix.html

    I hope this helps you.

    Regards,
    Marcelo.
  • SystemAdmin
    SystemAdmin
    6902 Posts

    Re: RCP error in AIX

    ‏2011-01-06T18:04:13Z  
    • mmveiga
    • ‏2010-12-31T21:01:59Z
    You can use files or key for authentication without passwords, key is better.
    A good resource is : http://www.openbsd.org/cgi-bin/man.cgi?query=ssh&sektion=1#AUTHENTICATION and the following page has information specific to AIX : http://www.ibm.com/developerworks/systems/articles/openssh_aix.html

    I hope this helps you.

    Regards,
    Marcelo.
    We're really hoping to get this working the way it was, and without installing additional software (we don't have SSH installed or use it at all on this system, since this network is isolated). But if we can't, I guess that's an alternative we'll have to look at. Thanks.
  • SystemAdmin
    SystemAdmin
    6902 Posts

    Re: RCP error in AIX

    ‏2011-01-06T18:55:06Z  
    Well, removing the old hardcoded entries from the /etc/hosts file did the trick. Very odd. Thanks!