Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 12 of 12
  1. #1
    Member
    Join Date
    Nov 2002
    Posts
    40
    cPanel/Enkompass Access Level

    Root Administrator

    Default Setup Remote Access Key Error

    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. #2
    Member
    Join Date
    Nov 2002
    Posts
    40
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    (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. #3
    Moderator cPanel Partner NOC Badge dgbaker's Avatar
    Join Date
    Sep 2002
    Location
    Toronto, Ontario Canada
    Posts
    2,773

    Default

    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&amp {
    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&amp ) {
    print &error setting gid\n&;
    exit;
    }
    if (! (($& = $uid) && ($& = $uid)) ) {
    die &error setting uid ($uid) [$user]\n&;
    }
    }


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

    }

    [BEGIN END]
    Regards,
    David
    Forum Moderator

  4. #4
    Member
    Join Date
    Nov 2002
    Posts
    40
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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. #5
    Moderator cPanel Partner NOC Badge dgbaker's Avatar
    Join Date
    Sep 2002
    Location
    Toronto, Ontario Canada
    Posts
    2,773

    Default

    Red Hat 7.3
    Perl 5.6.1
    Cpanel 5.3.0-EDGE 62
    Regards,
    David
    Forum Moderator

  6. #6
    sky
    sky is offline
    Member
    Join Date
    Nov 2002
    Posts
    93

    Default

    any updates on this one? I am using redhat 8 and i am having the same issue

  7. #7
    sky
    sky is offline
    Member
    Join Date
    Nov 2002
    Posts
    93

    Default

    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. #8
    sky
    sky is offline
    Member
    Join Date
    Nov 2002
    Posts
    93

    Default

    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. #9
    sky
    sky is offline
    Member
    Join Date
    Nov 2002
    Posts
    93

    Default

    anyone can guide me where to set it pls .. thanx

  10. #10
    sky
    sky is offline
    Member
    Join Date
    Nov 2002
    Posts
    93

    Default

    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. #11
    Registered User
    Join Date
    Apr 2002
    Posts
    3

    Default

    I have no idea how to fix it.Can someone please walk me through this? PLEASE

  12. #12
    sky
    sky is offline
    Member
    Join Date
    Nov 2002
    Posts
    93

    Default

    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

Similar Threads & Tags
Similar threads

  1. Server Setup - Setup Remote Access Key?
    By SoftmegUK in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 04-24-2010, 01:34 PM
  2. Replies: 8
    Last Post: 09-28-2006, 02:41 PM
  3. Remote Access Key - Setup Reseller
    By thaphantom in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-20-2003, 05:46 PM
  4. I have log my WHM and there is only "Setup Remote Access Key
    By enterwww in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 02-17-2003, 12:01 PM
  5. Setup Remote Access Key
    By gorgo in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 02-18-2002, 01:47 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube