Root login from serial console

Rajeev Bansal rajeevb at intoto.com
Thu Nov 8 05:21:54 UTC 2007


Thanks Denys. I could fix the problem, actually there was no /etc/shadow 
file in my root file system and in the /etc/passwd file, the root user 
entry was:
root:x:0:0:root:/root:/bin/ash
Since shadow file was missing so somehow login utility was never probing 
me for the password.

To solve this I created the /etc/shadow file and reset the root password 
and it worked for me.

Thanks a lot.
Rajeev Bansal.


Denys Vlasenko wrote:
> On Wednesday 07 November 2007 09:50, Rajeev Bansal wrote:
>   
>> Hi All,
>>
>> I am using the busybox in my root file system, everything is fine with 
>>     
>
> Which version of busybox do you use?
>
>   
>> that, except when I try to login as a root from serial console it 
>> doesn't prompt me for the password and immediately say "Login 
>> Incorrect".
>>     
>
> Do non-root logins work? Does it work if you configure
> busybox without CONFIG_FEATURE_SECURETTY=y?
>
>   
>> I need to login as a root from  serial console, so can  
>> anyone tell me how I can make it happen. I have a /etc/securetty file 
>> present and I have added the entry for ttyS0 in that.
>>     
>
> Sounds like you did everything right.
>
>   
>> I think login  
>> utility of busybox doesn't read the securetty file.
>>     
>
> It reads /etc/securetty here:
>
> #if ENABLE_FEATURE_SECURETTY && !ENABLE_PAM
> static int check_securetty(void)
> {
>         FILE *fp;
>         int i;
>         char buf[256];
>
>         fp = fopen("/etc/securetty", "r");
>         if (!fp) {
>                 /* A missing securetty file is not an error. */
>                 return 1;
>         }
>         while (fgets(buf, sizeof(buf)-1, fp)) {
>                 for (i = strlen(buf)-1; i >= 0; --i) {
>                         if (!isspace(buf[i]))
>                                 break;
>                 }
>                 buf[++i] = '\0';
>                 if (!buf[0] || (buf[0] == '#'))
>                         continue;
>                 if (strcmp(buf, short_tty) == 0) {
>                         fclose(fp);
>                         return 1;
>                 }
>         }
>         fclose(fp);
>         return 0;
> }
> #else
>
>
> and checks here:
>
>                 pw = getpwnam(username);
>                 if (!pw) {
>                         strcpy(username, "UNKNOWN");
>                         goto fake_it;
>                 }
>
>                 if (pw->pw_passwd[0] == '!' || pw->pw_passwd[0] == '*')
>                         goto auth_failed;
>
>                 if (opt & LOGIN_OPT_f)
>                         break; /* -f USER: success without asking passwd */
>
>                 if (pw->pw_uid == 0 && !check_securetty())  <==== HERE
>                         goto auth_failed;
>
> --
> vda
>
>
>   



********************************************************************************
This email message (including any attachments) is for the sole use of the intended recipient(s) 
and may contain confidential, proprietary and privileged information. Any unauthorized review, 
use, disclosure or distribution is prohibited. If you are not the intended recipient, 
please immediately notify the sender by reply email and destroy all copies of the original message. 
Thank you.
 
Intoto Inc. 




More information about the busybox mailing list