?
Solved

Using Linux Debian Lenny without graphic mode

Posted on 2008-10-07
6
Medium Priority
?
988 Views
Last Modified: 2013-12-15
Dear experts,

I have Linux debian Lenny  running in an AMD geode processor I need work without of graphic mode, it is possible?

Is possible that my username and password they are provided (ej. readed from a file) in order to start automatically ?.

my best regards,

cheers,


0
Comment
Question by:hernan007
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 40

Expert Comment

by:omarfarid
ID: 22665679
If you are familiar with linux commands then you may set the system to startup in non-gui mode and then you may set login from a particular terminal device (in linux it is called tty device) with specific user id with no password.

For running console with no gui, change the below line in /etc/inittab

From

id:5:initdefault:

To


id:3:initdefault:

For login with specific user with no password, I need to search for it and come back to you.
0
 
LVL 6

Expert Comment

by:ixti
ID: 22667109
This article at TLDP should help with autologin:
http://www.tldp.org/LDP/LG/issue27/kodis.html
0
 
LVL 35

Expert Comment

by:Duncan Roe
ID: 22667451
By experimenting on my own system, I think I have a solution for you. You need to substitute your user name for mine ("dunc"). This does not require any modifications to existing software, but it does hang on to the virtual console (VC) for ever - if you exit then you get a prompt from a fresh shell.
In /etc/inittab, for each console that you want to log in, put an entry like (for vc 6):

t1:3:respawn:/bin/sh -c "exec /bin/bash 1<>/dev/tty6 2>&1 0<&1 --rcfile /root/t6 -i"

This breaks down as follows:

t1: unique inittab identifier "test 1"
respawn: init will start another process when this one finishes (as I said above, this hangs on to the VC for ever)
/bin/sh -c "exec /bin/bash 1<>/dev/tty6 2>&1 0<&1 --rcfile /root/t6 -i": Start an interactive bash shell opening /dev/tty6 for input and output, set stderr and stdin to also go to /dev/tty6 (VC 6). As it happens, /dev/tty also points there as well. The shell is to initially obey the commands in /root/t6. This leads us on to:

/root/t6 is the file of initial commands that bash should obey:

20:44:10# cat /root/t6
chown dunc /dev/vc/6
exec su - dunc

The first line sets the ownership of the target VC to be owned by the desired eventual user (init starts everything as root). You need to set ownership on /dev/vc/6 and not /dev/tty6, because /dev/tty6 is a symbolic link and chown doesn't follow it for some reason (maybe because the target is a device special file). If you miss out that line it seems to work anyway, but you get a mystery error message "/dev/vc/6: Operation not permitted".
The second line sets the process to be run by the desired user. Because of doing exec, he cannot get back to being root by doing an exit. Because of "su -" and not just "su", the target user goes through a complete login sequence, reading .bash_profile etc.

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:hernan007
ID: 22672721
Hi thanks,  

in my /etc/inittab I have

id:2initdefault


where in runlevel is

0 is halt
1 is single user
2-5  are multi-user
6 is reboot

for multi-user are 2-5 ..what is the difference?  

on the other hand, I need use administrative services  with c++ for sample I need use the date function
but I have problems because I need use "su" or "sudo" , I dont know how I can use it

system ("su mypassword");  
system ("date mydate");

but its not work ...

thanks thanks
0
 

Author Comment

by:hernan007
ID: 22672895
Thanks omarfarid,

but your suggestion is the same for    

id:5initdefault   to  change to  id:3initdefault


:(  
0
 
LVL 35

Accepted Solution

by:
Duncan Roe earned 2000 total points
ID: 22673531
There may be no difference from 2 to 5, or maybe only level 2 is configured properly. Distributions vary a lot in what they do and I'm unfamiliar with yours. If it's at 2, just leave it there and change the line I gave you to:

t1:3:respawn:/bin/sh -c "exec /bin/bash 1<>/dev/tty6 2>&1 0<&1 --rcfile /root/t6 -i"

At the same time, you also need to ensure that init no longer starts a getty on that tty - I forgot to mention that before. Look for a line like

c6:12345:respawn:/sbin/agetty 38400 tty6 linux

and change it to

c6:1345:respawn:/sbin/agetty 38400 tty6 linux

(i.e. don't start a getty in runlevel 2).

The explanatory breakdown was missing  an important line too - it should have started:

t1: unique inittab identifier "test 1"
3: Do this action in runlevel 3 (and no other levels)
respawn: init will start another process when this one finishes (as I said above, this hangs on to the VC for ever)
(and so on as before)

Your c++ problems with trying to use system() are another problem altogether - please raise a new question in the Linux Programming topic area for that.
0

Featured Post

How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses
Course of the Month14 days, 5 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question