[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how do I create a kdm login for non-desktop user



On 22/07/11 22:22, Jari Fredriksson wrote:
> 22.7.2011 14:35, Mark Charles kirjoitti:
>> For remote maintenance I want to add a default user called
>> "fixme" with no password to the system.
>>
>> If the remote user has problems with their computer they should be able
>> to press Enter and "fixme" will login and run a script connecting the
>> machine to the internet and send me the IP address in an email.

You'll want to use curl or such to scrape the IP from a web page after
connecting - which would require running as root...
If the remote user is behind a firewall, ifconfig may not get you the
info you need anyway.

If you don't already have a script, pinch mine ;-p
=======================================================================
#!/bin/bash
# name, date, description
echo
echo "****************************************************************"
echo
echo  "This will take about a minute.... thanks for your patience Mum"
echo
echo "****************************************************************"
poff -a
sleep 5s
pon Dodo
IP=""
sleep 10s
IP=`curl -s http://myip.dk/ | egrep -m1 -o
'[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'`
if [[ -z $IP ]]
  then
    echo  "Things have not gone as planned - please ring me"
  else
    echo $IP | mailx -v -s "Remote assistance requested" -S
smtp-use-starttls -S ssl-verify=ignore -S smtp-auth=login -S
smtp=smtp://smtp.gmail.com:587 -S from="remote_user@gmail.com(Remote
User)" -S smtp-auth-user=remote_user_gmail_login -S
smtp-auth-password=remote_user_gmail_password -S ssl-verify=ignore -S
nss-config-dir=~/.mozilla/firefox/remote_user.default/
Support_email@address.whatever
  fi
exit 0
=======================================================================

>>
>> As "fixme" has no password I don't want them to have a desktop... how do
>> I do this??

You would have to seriously modify startkde(?) to create a forced
console login for a given user (fixme).

Alternatively create a desktop and restrict access to just konsole
(kiosk model using action restrictions). Make fixme a member only of
dial, dip, and, nobody (primary group).

>> I'd also prefer they don't have a home directory - is that possible??

See above. (I doubt it).

>> How can I setup fixme's login to just run my script??

If you stop kde from running for fixme - then just setting your script
as the home directory will work, otherwise:-
~.kde/Autostart
~/.kde/share/autostart

>>
> 
> Quite strange setup. But OK.

How so?
Sounds eminently logical to me (I do something similar) - remote
support, no local tech, no usable screen? - just hit enter to initiate
remote assistance.

Ever tried to talk a non-tech through the process of connecting to
mobile broadband without them having a working screen?

> 
> - Set the home folder to /tmp/fixme or some other proprietary folder.

Then log-in setup Nepumok, Strigi, Kaboom.... and whoops, it all
vanishes when you log out :-(
I suspect the OP wants to avoid a home directory if possible - not put
it somewhere, um, non-standard.
Which is possible - shell as /bin/false, home as
/usr/sbin/connect_internet_and_email_the_IP, primary group nobody, other
groups dip and dial - but not easily from a kdm login. Making fixme the
preselected username with the focus on password and login without
password allowed is simple - finding a simple way to secure that setup
is harder.

> - Set the shell for fixme to your script.

Which won't run the script......

<snipped>
I am working on something similar - hence the script, please post your
success here.

Cheers

-- 
"Today a young man on acid realized that all matter is merely energy
condensed to a slow vibration, that we are all one consciousness
experiencing itself subjectively, there is no such thing as death, life
is only a dream, and we are the imagination of ourselves. Here's Tom
with the Weather."
— Bill Hicks


Reply to: