Auto login into router running Busybox

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












My router runs Linux with embedded Busybox. I'd like to autologin and run a web browser. Here is the /etc/inittab file:



# /etc/inittab init(8) configuration for BusyBox
#
# Copyright (C) 1999-2004 by Erik Andersen
#
#
# Note, BusyBox init doesn't support runlevels. The runlevels field is
# completely ignored by BusyBox init. If you want runlevels, use sysvinit.
#
#
# Format for each entry: :::
#
# : WARNING: This field has a non-traditional meaning for BusyBox init!
#
# The id field is used by BusyBox init to specify the controlling tty for
# the specified process to run on. The contents of this field are
# appended to "/dev/" and used as-is. There is no need for this field to
# be unique, although if it isn't you may have strange results. If this
# field is left blank, it is completely ignored. Also note that if
# BusyBox detects that a serial console is in use, then all entries
# containing non-empty id fields will _not_ be run. BusyBox init does
# nothing with utmp. We don't need no stinkin' utmp.
#
# : The runlevels field is completely ignored.
#
# : Valid actions include: sysinit, respawn, askfirst, wait, once,
# restart, ctrlaltdel, and shutdown.
#
# Note: askfirst acts just like respawn, but before running the specified
# process it displays the line "Please press Enter to activate this
# console." and then waits for the user to press enter before starting
# the specified process.
#
# Note: unrecognised actions (like initdefault) will cause init to emit
# an error message, and then go along with its business.
#
# : Specifies the process to be executed and it's command line.
#
# Note: BusyBox init works just fine without an inittab. If no inittab is
# found, it has the following default behavior:
::once:/usr/sbin/usbconsole
::sysinit:/etc/init.d/rcS
::ctrlaltdel:/sbin/reboot
::shutdown:/etc/init.d/rc.shutdown
::shutdown:/sbin/swapoff -a
::shutdown:/bin/umount -a -r
::restart:/sbin/init
#
# if it detects that /dev/console is _not_ a serial console, it will
# also run:
# tty2::askfirst:/bin/sh
# tty3::askfirst:/bin/sh
# tty4::askfirst:/bin/sh
#
# Boot-time system configuration/initialization script.
# This is run first except when booting in single-user mode.
#
# ::sysinit:/etc/init.d/rcS
# ::sysinit:/linuxrc

# /bin/sh invocations on selected ttys
#
# Note below that we prefix the shell commands with a "-" to indicate to the
# shell that it is supposed to be a login shell. Normally this is handled by
# login, but since we are bypassing login in this case, BusyBox lets you do
# this yourself...
#
# Start an "askfirst" shell on the console (whatever that may be)

::askfirst:-/bin/sh

# Start an "askfirst" shell on /dev/tty2-4
# tty2::askfirst:-/bin/sh
# tty3::askfirst:-/bin/sh
# tty4::askfirst:-/bin/sh

# /sbin/getty invocations for selected ttys
# tty4::respawn:/sbin/getty 38400 tty5
# tty5::respawn:/sbin/getty 38400 tty6

# Example of how to put a getty on a serial line (for a terminal)
#::respawn:/sbin/getty -L ttyS0 115200 vt100

My router runs Linux embedded with Busybox. I'd like to autologin and run a web browser on boot. Here is the `/etc/inittab file`:
#
# Example how to put a getty on a modem line.
#::respawn:/sbin/getty 57600 ttyS2

# Stuff to do when restarting the init process
# ::restart:/sbin/init

# Stuff to do before rebooting
# ::ctrlaltdel:/sbin/reboot
# ::shutdown:/bin/umount -a -r
# ::shutdown:/sbin/swapoff -a









share|improve this question























  • what have you tried ? besides inittab is of no use here. have you check ssh and keys ? have you check any of the link on the right (Related) ?
    – Archemar
    Apr 16 '15 at 5:03










  • I tried to edit the inittab file so that when I boot up the router it can automatically login as root into the desktop mode. I aslo tried deleting the file since the inittab file said BusyBox init works just fine without an inittab. If no inittab is found, it has the following default behavior:(code listed above), but when I rebooted the system it hang at the cisco logo.
    – unixnewbie
    Apr 16 '15 at 15:10














up vote
2
down vote

favorite












My router runs Linux with embedded Busybox. I'd like to autologin and run a web browser. Here is the /etc/inittab file:



# /etc/inittab init(8) configuration for BusyBox
#
# Copyright (C) 1999-2004 by Erik Andersen
#
#
# Note, BusyBox init doesn't support runlevels. The runlevels field is
# completely ignored by BusyBox init. If you want runlevels, use sysvinit.
#
#
# Format for each entry: :::
#
# : WARNING: This field has a non-traditional meaning for BusyBox init!
#
# The id field is used by BusyBox init to specify the controlling tty for
# the specified process to run on. The contents of this field are
# appended to "/dev/" and used as-is. There is no need for this field to
# be unique, although if it isn't you may have strange results. If this
# field is left blank, it is completely ignored. Also note that if
# BusyBox detects that a serial console is in use, then all entries
# containing non-empty id fields will _not_ be run. BusyBox init does
# nothing with utmp. We don't need no stinkin' utmp.
#
# : The runlevels field is completely ignored.
#
# : Valid actions include: sysinit, respawn, askfirst, wait, once,
# restart, ctrlaltdel, and shutdown.
#
# Note: askfirst acts just like respawn, but before running the specified
# process it displays the line "Please press Enter to activate this
# console." and then waits for the user to press enter before starting
# the specified process.
#
# Note: unrecognised actions (like initdefault) will cause init to emit
# an error message, and then go along with its business.
#
# : Specifies the process to be executed and it's command line.
#
# Note: BusyBox init works just fine without an inittab. If no inittab is
# found, it has the following default behavior:
::once:/usr/sbin/usbconsole
::sysinit:/etc/init.d/rcS
::ctrlaltdel:/sbin/reboot
::shutdown:/etc/init.d/rc.shutdown
::shutdown:/sbin/swapoff -a
::shutdown:/bin/umount -a -r
::restart:/sbin/init
#
# if it detects that /dev/console is _not_ a serial console, it will
# also run:
# tty2::askfirst:/bin/sh
# tty3::askfirst:/bin/sh
# tty4::askfirst:/bin/sh
#
# Boot-time system configuration/initialization script.
# This is run first except when booting in single-user mode.
#
# ::sysinit:/etc/init.d/rcS
# ::sysinit:/linuxrc

# /bin/sh invocations on selected ttys
#
# Note below that we prefix the shell commands with a "-" to indicate to the
# shell that it is supposed to be a login shell. Normally this is handled by
# login, but since we are bypassing login in this case, BusyBox lets you do
# this yourself...
#
# Start an "askfirst" shell on the console (whatever that may be)

::askfirst:-/bin/sh

# Start an "askfirst" shell on /dev/tty2-4
# tty2::askfirst:-/bin/sh
# tty3::askfirst:-/bin/sh
# tty4::askfirst:-/bin/sh

# /sbin/getty invocations for selected ttys
# tty4::respawn:/sbin/getty 38400 tty5
# tty5::respawn:/sbin/getty 38400 tty6

# Example of how to put a getty on a serial line (for a terminal)
#::respawn:/sbin/getty -L ttyS0 115200 vt100

My router runs Linux embedded with Busybox. I'd like to autologin and run a web browser on boot. Here is the `/etc/inittab file`:
#
# Example how to put a getty on a modem line.
#::respawn:/sbin/getty 57600 ttyS2

# Stuff to do when restarting the init process
# ::restart:/sbin/init

# Stuff to do before rebooting
# ::ctrlaltdel:/sbin/reboot
# ::shutdown:/bin/umount -a -r
# ::shutdown:/sbin/swapoff -a









share|improve this question























  • what have you tried ? besides inittab is of no use here. have you check ssh and keys ? have you check any of the link on the right (Related) ?
    – Archemar
    Apr 16 '15 at 5:03










  • I tried to edit the inittab file so that when I boot up the router it can automatically login as root into the desktop mode. I aslo tried deleting the file since the inittab file said BusyBox init works just fine without an inittab. If no inittab is found, it has the following default behavior:(code listed above), but when I rebooted the system it hang at the cisco logo.
    – unixnewbie
    Apr 16 '15 at 15:10












up vote
2
down vote

favorite









up vote
2
down vote

favorite











My router runs Linux with embedded Busybox. I'd like to autologin and run a web browser. Here is the /etc/inittab file:



# /etc/inittab init(8) configuration for BusyBox
#
# Copyright (C) 1999-2004 by Erik Andersen
#
#
# Note, BusyBox init doesn't support runlevels. The runlevels field is
# completely ignored by BusyBox init. If you want runlevels, use sysvinit.
#
#
# Format for each entry: :::
#
# : WARNING: This field has a non-traditional meaning for BusyBox init!
#
# The id field is used by BusyBox init to specify the controlling tty for
# the specified process to run on. The contents of this field are
# appended to "/dev/" and used as-is. There is no need for this field to
# be unique, although if it isn't you may have strange results. If this
# field is left blank, it is completely ignored. Also note that if
# BusyBox detects that a serial console is in use, then all entries
# containing non-empty id fields will _not_ be run. BusyBox init does
# nothing with utmp. We don't need no stinkin' utmp.
#
# : The runlevels field is completely ignored.
#
# : Valid actions include: sysinit, respawn, askfirst, wait, once,
# restart, ctrlaltdel, and shutdown.
#
# Note: askfirst acts just like respawn, but before running the specified
# process it displays the line "Please press Enter to activate this
# console." and then waits for the user to press enter before starting
# the specified process.
#
# Note: unrecognised actions (like initdefault) will cause init to emit
# an error message, and then go along with its business.
#
# : Specifies the process to be executed and it's command line.
#
# Note: BusyBox init works just fine without an inittab. If no inittab is
# found, it has the following default behavior:
::once:/usr/sbin/usbconsole
::sysinit:/etc/init.d/rcS
::ctrlaltdel:/sbin/reboot
::shutdown:/etc/init.d/rc.shutdown
::shutdown:/sbin/swapoff -a
::shutdown:/bin/umount -a -r
::restart:/sbin/init
#
# if it detects that /dev/console is _not_ a serial console, it will
# also run:
# tty2::askfirst:/bin/sh
# tty3::askfirst:/bin/sh
# tty4::askfirst:/bin/sh
#
# Boot-time system configuration/initialization script.
# This is run first except when booting in single-user mode.
#
# ::sysinit:/etc/init.d/rcS
# ::sysinit:/linuxrc

# /bin/sh invocations on selected ttys
#
# Note below that we prefix the shell commands with a "-" to indicate to the
# shell that it is supposed to be a login shell. Normally this is handled by
# login, but since we are bypassing login in this case, BusyBox lets you do
# this yourself...
#
# Start an "askfirst" shell on the console (whatever that may be)

::askfirst:-/bin/sh

# Start an "askfirst" shell on /dev/tty2-4
# tty2::askfirst:-/bin/sh
# tty3::askfirst:-/bin/sh
# tty4::askfirst:-/bin/sh

# /sbin/getty invocations for selected ttys
# tty4::respawn:/sbin/getty 38400 tty5
# tty5::respawn:/sbin/getty 38400 tty6

# Example of how to put a getty on a serial line (for a terminal)
#::respawn:/sbin/getty -L ttyS0 115200 vt100

My router runs Linux embedded with Busybox. I'd like to autologin and run a web browser on boot. Here is the `/etc/inittab file`:
#
# Example how to put a getty on a modem line.
#::respawn:/sbin/getty 57600 ttyS2

# Stuff to do when restarting the init process
# ::restart:/sbin/init

# Stuff to do before rebooting
# ::ctrlaltdel:/sbin/reboot
# ::shutdown:/bin/umount -a -r
# ::shutdown:/sbin/swapoff -a









share|improve this question















My router runs Linux with embedded Busybox. I'd like to autologin and run a web browser. Here is the /etc/inittab file:



# /etc/inittab init(8) configuration for BusyBox
#
# Copyright (C) 1999-2004 by Erik Andersen
#
#
# Note, BusyBox init doesn't support runlevels. The runlevels field is
# completely ignored by BusyBox init. If you want runlevels, use sysvinit.
#
#
# Format for each entry: :::
#
# : WARNING: This field has a non-traditional meaning for BusyBox init!
#
# The id field is used by BusyBox init to specify the controlling tty for
# the specified process to run on. The contents of this field are
# appended to "/dev/" and used as-is. There is no need for this field to
# be unique, although if it isn't you may have strange results. If this
# field is left blank, it is completely ignored. Also note that if
# BusyBox detects that a serial console is in use, then all entries
# containing non-empty id fields will _not_ be run. BusyBox init does
# nothing with utmp. We don't need no stinkin' utmp.
#
# : The runlevels field is completely ignored.
#
# : Valid actions include: sysinit, respawn, askfirst, wait, once,
# restart, ctrlaltdel, and shutdown.
#
# Note: askfirst acts just like respawn, but before running the specified
# process it displays the line "Please press Enter to activate this
# console." and then waits for the user to press enter before starting
# the specified process.
#
# Note: unrecognised actions (like initdefault) will cause init to emit
# an error message, and then go along with its business.
#
# : Specifies the process to be executed and it's command line.
#
# Note: BusyBox init works just fine without an inittab. If no inittab is
# found, it has the following default behavior:
::once:/usr/sbin/usbconsole
::sysinit:/etc/init.d/rcS
::ctrlaltdel:/sbin/reboot
::shutdown:/etc/init.d/rc.shutdown
::shutdown:/sbin/swapoff -a
::shutdown:/bin/umount -a -r
::restart:/sbin/init
#
# if it detects that /dev/console is _not_ a serial console, it will
# also run:
# tty2::askfirst:/bin/sh
# tty3::askfirst:/bin/sh
# tty4::askfirst:/bin/sh
#
# Boot-time system configuration/initialization script.
# This is run first except when booting in single-user mode.
#
# ::sysinit:/etc/init.d/rcS
# ::sysinit:/linuxrc

# /bin/sh invocations on selected ttys
#
# Note below that we prefix the shell commands with a "-" to indicate to the
# shell that it is supposed to be a login shell. Normally this is handled by
# login, but since we are bypassing login in this case, BusyBox lets you do
# this yourself...
#
# Start an "askfirst" shell on the console (whatever that may be)

::askfirst:-/bin/sh

# Start an "askfirst" shell on /dev/tty2-4
# tty2::askfirst:-/bin/sh
# tty3::askfirst:-/bin/sh
# tty4::askfirst:-/bin/sh

# /sbin/getty invocations for selected ttys
# tty4::respawn:/sbin/getty 38400 tty5
# tty5::respawn:/sbin/getty 38400 tty6

# Example of how to put a getty on a serial line (for a terminal)
#::respawn:/sbin/getty -L ttyS0 115200 vt100

My router runs Linux embedded with Busybox. I'd like to autologin and run a web browser on boot. Here is the `/etc/inittab file`:
#
# Example how to put a getty on a modem line.
#::respawn:/sbin/getty 57600 ttyS2

# Stuff to do when restarting the init process
# ::restart:/sbin/init

# Stuff to do before rebooting
# ::ctrlaltdel:/sbin/reboot
# ::shutdown:/bin/umount -a -r
# ::shutdown:/sbin/swapoff -a






init-script busybox autologin






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 15 '15 at 23:55









jasonwryan

47.7k14131180




47.7k14131180










asked Apr 15 '15 at 23:43









unixnewbie

112




112











  • what have you tried ? besides inittab is of no use here. have you check ssh and keys ? have you check any of the link on the right (Related) ?
    – Archemar
    Apr 16 '15 at 5:03










  • I tried to edit the inittab file so that when I boot up the router it can automatically login as root into the desktop mode. I aslo tried deleting the file since the inittab file said BusyBox init works just fine without an inittab. If no inittab is found, it has the following default behavior:(code listed above), but when I rebooted the system it hang at the cisco logo.
    – unixnewbie
    Apr 16 '15 at 15:10
















  • what have you tried ? besides inittab is of no use here. have you check ssh and keys ? have you check any of the link on the right (Related) ?
    – Archemar
    Apr 16 '15 at 5:03










  • I tried to edit the inittab file so that when I boot up the router it can automatically login as root into the desktop mode. I aslo tried deleting the file since the inittab file said BusyBox init works just fine without an inittab. If no inittab is found, it has the following default behavior:(code listed above), but when I rebooted the system it hang at the cisco logo.
    – unixnewbie
    Apr 16 '15 at 15:10















what have you tried ? besides inittab is of no use here. have you check ssh and keys ? have you check any of the link on the right (Related) ?
– Archemar
Apr 16 '15 at 5:03




what have you tried ? besides inittab is of no use here. have you check ssh and keys ? have you check any of the link on the right (Related) ?
– Archemar
Apr 16 '15 at 5:03












I tried to edit the inittab file so that when I boot up the router it can automatically login as root into the desktop mode. I aslo tried deleting the file since the inittab file said BusyBox init works just fine without an inittab. If no inittab is found, it has the following default behavior:(code listed above), but when I rebooted the system it hang at the cisco logo.
– unixnewbie
Apr 16 '15 at 15:10




I tried to edit the inittab file so that when I boot up the router it can automatically login as root into the desktop mode. I aslo tried deleting the file since the inittab file said BusyBox init works just fine without an inittab. If no inittab is found, it has the following default behavior:(code listed above), but when I rebooted the system it hang at the cisco logo.
– unixnewbie
Apr 16 '15 at 15:10










2 Answers
2






active

oldest

votes

















up vote
2
down vote













Probably a slightly late answer, but I've decided to add it anyway.



Hanging at the Cisco logo (or whatever else) is the expected behaviour in the case when the /etc/inittab file is empty. The answer depends on how you want to log into the machine. Uncommenting the line:



::respawn:/sbin/getty -L ttyS0 115200 vt100


allows you to provide login prompt on /dev/ttyS0. Assuming that you have connected over serial /dev/ttyS0 (be sure that this is in fact your interface, e.g., at my machine it is /dev/ttyPS0), the auto-login can be realised by adding:



ttyPS0::respawn:/bin/login -f <user>


This should auto log-in you as the <user>.
The other approach that uses /sbin/getty and custom-made auto-login utility is described here.



If you want to automatically log-in using, e.g., /dev/tty3, you can modify the example. The auto-start of browser will depend on the X and the browser you use. I would modify the ~/.profile or ~/.bashrc in your $HOME directory (typically /home/<user>) by adding at the end something like:



startx
google-chrome-stable &


Note, however, that if you're connected to the router over some serial/USB cable this may not work.






share|improve this answer






















  • You likely want to add a leading dash -/bin/login as explained in my answer: unix.stackexchange.com/a/474733/32558
    – Ciro Santilli 新疆改造中心 六四事件 法轮功
    14 mins ago

















up vote
0
down vote













I don't have a router to test, but at least on Buildroot + BusyBox + QEMU the following fstab entry logs you in automatically and makes everything seem to work normally:



::respawn:-/bin/sh


as I've explained at: How to login automatically without typing the root username or password in Buildroot BusyBox init?



Don't forget the leading -! Otherwise TTY interaction is a bit broken, e.g. you lose the ability to do Ctrl + C to kill the foreground program.



If you want to login as another user, you can use /bin/login as mentioned at https://unix.stackexchange.com/a/434799/32558 but you likely want to add the dash in front of it as well, for the same reason as /bin/sh:



::respawn:-/bin/login -f user0





share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f196485%2fauto-login-into-router-running-busybox%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    Probably a slightly late answer, but I've decided to add it anyway.



    Hanging at the Cisco logo (or whatever else) is the expected behaviour in the case when the /etc/inittab file is empty. The answer depends on how you want to log into the machine. Uncommenting the line:



    ::respawn:/sbin/getty -L ttyS0 115200 vt100


    allows you to provide login prompt on /dev/ttyS0. Assuming that you have connected over serial /dev/ttyS0 (be sure that this is in fact your interface, e.g., at my machine it is /dev/ttyPS0), the auto-login can be realised by adding:



    ttyPS0::respawn:/bin/login -f <user>


    This should auto log-in you as the <user>.
    The other approach that uses /sbin/getty and custom-made auto-login utility is described here.



    If you want to automatically log-in using, e.g., /dev/tty3, you can modify the example. The auto-start of browser will depend on the X and the browser you use. I would modify the ~/.profile or ~/.bashrc in your $HOME directory (typically /home/<user>) by adding at the end something like:



    startx
    google-chrome-stable &


    Note, however, that if you're connected to the router over some serial/USB cable this may not work.






    share|improve this answer






















    • You likely want to add a leading dash -/bin/login as explained in my answer: unix.stackexchange.com/a/474733/32558
      – Ciro Santilli 新疆改造中心 六四事件 法轮功
      14 mins ago














    up vote
    2
    down vote













    Probably a slightly late answer, but I've decided to add it anyway.



    Hanging at the Cisco logo (or whatever else) is the expected behaviour in the case when the /etc/inittab file is empty. The answer depends on how you want to log into the machine. Uncommenting the line:



    ::respawn:/sbin/getty -L ttyS0 115200 vt100


    allows you to provide login prompt on /dev/ttyS0. Assuming that you have connected over serial /dev/ttyS0 (be sure that this is in fact your interface, e.g., at my machine it is /dev/ttyPS0), the auto-login can be realised by adding:



    ttyPS0::respawn:/bin/login -f <user>


    This should auto log-in you as the <user>.
    The other approach that uses /sbin/getty and custom-made auto-login utility is described here.



    If you want to automatically log-in using, e.g., /dev/tty3, you can modify the example. The auto-start of browser will depend on the X and the browser you use. I would modify the ~/.profile or ~/.bashrc in your $HOME directory (typically /home/<user>) by adding at the end something like:



    startx
    google-chrome-stable &


    Note, however, that if you're connected to the router over some serial/USB cable this may not work.






    share|improve this answer






















    • You likely want to add a leading dash -/bin/login as explained in my answer: unix.stackexchange.com/a/474733/32558
      – Ciro Santilli 新疆改造中心 六四事件 法轮功
      14 mins ago












    up vote
    2
    down vote










    up vote
    2
    down vote









    Probably a slightly late answer, but I've decided to add it anyway.



    Hanging at the Cisco logo (or whatever else) is the expected behaviour in the case when the /etc/inittab file is empty. The answer depends on how you want to log into the machine. Uncommenting the line:



    ::respawn:/sbin/getty -L ttyS0 115200 vt100


    allows you to provide login prompt on /dev/ttyS0. Assuming that you have connected over serial /dev/ttyS0 (be sure that this is in fact your interface, e.g., at my machine it is /dev/ttyPS0), the auto-login can be realised by adding:



    ttyPS0::respawn:/bin/login -f <user>


    This should auto log-in you as the <user>.
    The other approach that uses /sbin/getty and custom-made auto-login utility is described here.



    If you want to automatically log-in using, e.g., /dev/tty3, you can modify the example. The auto-start of browser will depend on the X and the browser you use. I would modify the ~/.profile or ~/.bashrc in your $HOME directory (typically /home/<user>) by adding at the end something like:



    startx
    google-chrome-stable &


    Note, however, that if you're connected to the router over some serial/USB cable this may not work.






    share|improve this answer














    Probably a slightly late answer, but I've decided to add it anyway.



    Hanging at the Cisco logo (or whatever else) is the expected behaviour in the case when the /etc/inittab file is empty. The answer depends on how you want to log into the machine. Uncommenting the line:



    ::respawn:/sbin/getty -L ttyS0 115200 vt100


    allows you to provide login prompt on /dev/ttyS0. Assuming that you have connected over serial /dev/ttyS0 (be sure that this is in fact your interface, e.g., at my machine it is /dev/ttyPS0), the auto-login can be realised by adding:



    ttyPS0::respawn:/bin/login -f <user>


    This should auto log-in you as the <user>.
    The other approach that uses /sbin/getty and custom-made auto-login utility is described here.



    If you want to automatically log-in using, e.g., /dev/tty3, you can modify the example. The auto-start of browser will depend on the X and the browser you use. I would modify the ~/.profile or ~/.bashrc in your $HOME directory (typically /home/<user>) by adding at the end something like:



    startx
    google-chrome-stable &


    Note, however, that if you're connected to the router over some serial/USB cable this may not work.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jun 14 at 7:51

























    answered Apr 1 at 8:50









    shycha

    314




    314











    • You likely want to add a leading dash -/bin/login as explained in my answer: unix.stackexchange.com/a/474733/32558
      – Ciro Santilli 新疆改造中心 六四事件 法轮功
      14 mins ago
















    • You likely want to add a leading dash -/bin/login as explained in my answer: unix.stackexchange.com/a/474733/32558
      – Ciro Santilli 新疆改造中心 六四事件 法轮功
      14 mins ago















    You likely want to add a leading dash -/bin/login as explained in my answer: unix.stackexchange.com/a/474733/32558
    – Ciro Santilli 新疆改造中心 六四事件 法轮功
    14 mins ago




    You likely want to add a leading dash -/bin/login as explained in my answer: unix.stackexchange.com/a/474733/32558
    – Ciro Santilli 新疆改造中心 六四事件 法轮功
    14 mins ago












    up vote
    0
    down vote













    I don't have a router to test, but at least on Buildroot + BusyBox + QEMU the following fstab entry logs you in automatically and makes everything seem to work normally:



    ::respawn:-/bin/sh


    as I've explained at: How to login automatically without typing the root username or password in Buildroot BusyBox init?



    Don't forget the leading -! Otherwise TTY interaction is a bit broken, e.g. you lose the ability to do Ctrl + C to kill the foreground program.



    If you want to login as another user, you can use /bin/login as mentioned at https://unix.stackexchange.com/a/434799/32558 but you likely want to add the dash in front of it as well, for the same reason as /bin/sh:



    ::respawn:-/bin/login -f user0





    share|improve this answer
























      up vote
      0
      down vote













      I don't have a router to test, but at least on Buildroot + BusyBox + QEMU the following fstab entry logs you in automatically and makes everything seem to work normally:



      ::respawn:-/bin/sh


      as I've explained at: How to login automatically without typing the root username or password in Buildroot BusyBox init?



      Don't forget the leading -! Otherwise TTY interaction is a bit broken, e.g. you lose the ability to do Ctrl + C to kill the foreground program.



      If you want to login as another user, you can use /bin/login as mentioned at https://unix.stackexchange.com/a/434799/32558 but you likely want to add the dash in front of it as well, for the same reason as /bin/sh:



      ::respawn:-/bin/login -f user0





      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        I don't have a router to test, but at least on Buildroot + BusyBox + QEMU the following fstab entry logs you in automatically and makes everything seem to work normally:



        ::respawn:-/bin/sh


        as I've explained at: How to login automatically without typing the root username or password in Buildroot BusyBox init?



        Don't forget the leading -! Otherwise TTY interaction is a bit broken, e.g. you lose the ability to do Ctrl + C to kill the foreground program.



        If you want to login as another user, you can use /bin/login as mentioned at https://unix.stackexchange.com/a/434799/32558 but you likely want to add the dash in front of it as well, for the same reason as /bin/sh:



        ::respawn:-/bin/login -f user0





        share|improve this answer












        I don't have a router to test, but at least on Buildroot + BusyBox + QEMU the following fstab entry logs you in automatically and makes everything seem to work normally:



        ::respawn:-/bin/sh


        as I've explained at: How to login automatically without typing the root username or password in Buildroot BusyBox init?



        Don't forget the leading -! Otherwise TTY interaction is a bit broken, e.g. you lose the ability to do Ctrl + C to kill the foreground program.



        If you want to login as another user, you can use /bin/login as mentioned at https://unix.stackexchange.com/a/434799/32558 but you likely want to add the dash in front of it as well, for the same reason as /bin/sh:



        ::respawn:-/bin/login -f user0






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 17 mins ago









        Ciro Santilli 新疆改造中心 六四事件 法轮功

        4,43123938




        4,43123938



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f196485%2fauto-login-into-router-running-busybox%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Christian Cage

            How to properly install USB display driver for Fresco Logic FL2000DX on Ubuntu?