The Community Forums

Interact with an entire community of cPanel & WHM users.
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Setup Remote Access Key Error

Discussion in 'General Discussion' started by Dathorn_ADT, Nov 24, 2002.

  1. Dathorn_ADT

    Dathorn_ADT Active Member

    Joined:
    Nov 16, 2002
    Messages:
    41
    Likes Received:
    1
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Whenever I go to setup a remote access key and generate a new key I get:

    Wide character in subroutine entry at /usr/local/cpanel/bin/mkaccesshash line 10.

    Any help would be greatly appreciated.

    Edit: Could someone even show me what their mkaccesshash script is or attach it so I can compare the two? Also tell me what OS you are running and version of cPanel / WHM.

    Andrew
     
  2. Dathorn_ADT

    Dathorn_ADT Active Member

    Joined:
    Nov 16, 2002
    Messages:
    41
    Likes Received:
    1
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    (bump)

    Please someone? I just need to see the script on your server and it's completely standard so it's not like I'll be getting any information about your server.
     
  3. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Our's looks like this

    [BEGIN]

    #!/usr/bin/perl

    use Digest::MD5 qw(md5 md5_hex md5_base64);
    $hash = '';
    for ($i=1;$i&30;$i++) {
    open(URAND,&/dev/urandom&);
    read(URAND,$random,4096);
    close(URAND);
    if ($i % 1 == 0) {
    $hash = $hash . &\n& . md5_hex($random);
    } else {
    $hash = $hash . md5_hex($random);
    }
    }

    if ($ENV{'REMOTE_USER'} ne &root&) {
    setuid($ENV{'REMOTE_USER'});
    }

    my $homedir = gethomedir($ENV{'REMOTE_USER'});
    $homedir =~ /(.*)/;
    $homedir = $1;

    open(PHASH,&&$homedir/.accesshash&);
    print PHASH &$hash&;
    close(PHASH);


    sub setuid {
    ($user) = @_;
    ($name,$passwd,$uid,$gid,
    $quota,$comment,$gcos,$dir,$shell,$expire) = getpwnam($user);

    if( $uid eq && ) {
    print &Security error, cannot get uid for $user\n&;
    exit();
    }

    if ( ! ($( = int($gid)) ) {
    print &error setting gid\n&;
    exit;
    }
    if ( ! ($) = &$gid $gid&) ) {
    print &error setting gid\n&;
    exit;
    }
    if (! (($& = $uid) && ($& = $uid)) ) {
    die &error setting uid ($uid) [$user]\n&;
    }
    }


    sub gethomedir {
    my($user) = $_[0];
    if ($user eq &&) { return &&; }
    my($homedir);
    open(PASSWD,&/etc/passwd&);
    while(&PASSWD&) {
    if (/^$user:/) {
    (undef,undef,undef,undef,undef,$homedir,undef) = split(/:/, $_, 7);
    close(PASSWD);
    return $homedir;
    }
    }
    close(PASSWD);

    }

    [BEGIN END]
     
  4. Dathorn_ADT

    Dathorn_ADT Active Member

    Joined:
    Nov 16, 2002
    Messages:
    41
    Likes Received:
    1
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Wonderful. Your script matches mine exactly. What OS, cPanel, and Perl are you running? I'm thinking it might be a problem with Red HAt 8.0 or Perl 5.8.0 or even the Digest::MD5 module that is installed but I'm not sure.
     
  5. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    Red Hat 7.3
    Perl 5.6.1
    Cpanel 5.3.0-EDGE 62
     
  6. sky

    sky Well-Known Member

    Joined:
    Nov 24, 2002
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    0
    any updates on this one? I am using redhat 8 and i am having the same issue
     
  7. sky

    sky Well-Known Member

    Joined:
    Nov 24, 2002
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    0
    hmm it seems from my readings ... it has to be associated with language or character type ........

    anyone can shed a light on this one ? i need to get the key up so that i can integrate it with modern bill
     
  8. sky

    sky Well-Known Member

    Joined:
    Nov 24, 2002
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    0
    ok this is what i got. After searching and checking ... it is the $LANG env var. ...

    ******** cut cut**************
    root@daylight [/usr/local/cpanel/bin]# ./mkaccesshash
    Wide character in subroutine entry at ./mkaccesshash line 10.
    root@daylight [/usr/local/cpanel/bin]# echo $LANG
    en_US.UTF-8
    root@daylight [/usr/local/cpanel/bin]# export LANG=en_US
    root@daylight [/usr/local/cpanel/bin]# ./mkaccesshash
    Security error, cannot get uid for
    root@daylight [/usr/local/cpanel/bin]#
    ******** cut cut**************

    notice how it works after i set $LANG to en_US. This is on a test server and it is running Redhat 8.0.

    let me see if setting the $LANG for web user will help
     
  9. sky

    sky Well-Known Member

    Joined:
    Nov 24, 2002
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    0
    anyone can guide me where to set it pls .. thanx
     
  10. sky

    sky Well-Known Member

    Joined:
    Nov 24, 2002
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    0
    ok solved this issue!

    for REDHAT 8.0 users
    in file /etc/sysconfig/i18n

    set the LANG parameter to en_US

    example:
    LANG=&en_US&
    SUPPORTED=&en_US.UTF-8:en_US:en&
    SYSFONT=&latarcyrheb-sun16&



    to verify, just check phpinfo() under Environment. It works for me!
     
  11. djboston

    djboston Registered

    Joined:
    Apr 18, 2002
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I have no idea how to fix it.Can someone please walk me through this? PLEASE
     
  12. sky

    sky Well-Known Member

    Joined:
    Nov 24, 2002
    Messages:
    92
    Likes Received:
    0
    Trophy Points:
    0
    ok boston .... here it is

    ok solved this issue!

    1) ssh into your server as root
    2) do an edit with vi or pico on the file /etc/sysconfig/i18n
    3) You will see line LANG=&en_US.UTF-8&
    4) change that to LANG=&en_US&
    5) save the file and reboot your machine
     
Loading...

Share This Page