2019年5月13日

[Linux] rsh login fails with error "remuser too long"

rsh login fails with error "remuser too long"


Environment
  • Red Hat Enterprise Linux 6
Issue
  • rsh login fails with error "remuser too long"
Resolution
Username should be less than 16 bytes when using rsh.

Root Cause

Username limitation 16bytes can be found in rshd source code:
static void
doit(struct sockaddr_storage *fromp, socklen_t fromlen)
{
        char *cmdbuf;
        long cmdbuflen;
        const char *theshell, *shellname;
        char locuser[16], remuser[16];
...
        getstr(remuser, sizeof(remuser), "remuser");  <=========

沒有留言: