Torsdag 05 juni 2008 15:31, skrev Petter Reinholdtsen:
> I just discovered a way that will solve a long standing problem with
> LTSP in Debian Edu. The problem is simply that none of the users
> logged in from a thin client show up as logged in on the thin client
> server. The reason is how SSH works, by default not updating
> /var/run/utmp when ssh is used to run a command remotely (as in 'ssh
> somehost command'). This can be changed by forcing ssh to allocate a
> tty using -t.
>
> To demonstrate:
>
> % ssh user.skolelinux.no who|grep pere
> %ssh -t user.skolelinux.no who|grep pere
> Connection to user.skolelinux.no closed.
> pere pts/6 2008-06-05 15:29 (88.131.81.122)
> %
>
> I have yet to test this on a thin client, but suspect all we need to
> do is to change the ssh call in ldm to add -t.
>
> JFYI.
>
> Happy hacking,
> --
> Petter Reinholdtsen
I use this little perl script to list my users along with which terminal
they are logged on to:
#!/usr/bin/perl
use Socket;
open(FH, "ps eaxw -o args |");
while (<FH>) {
if ($_ =~ /bash --login -c.*USER=(.*?)\s.*SSH_CLIENT=(.*?)\s.*/)
{
$name = gethostbyaddr(inet_aton($2), AF_INET) or \
print STDERR "Can't resolve $2: $!\n";
print "$1\t$2\t$name\n";
}
}
For sure who would be nice having working as well.
--
Klaus Ade
Mobil:93869567
67E61D18B2C44F8A3DA35C6D849F9F5F 26FA477D
Attachment:
pgpsZVaNPOKUo.pgp
Description: PGP signature