Picon

manage an sftp conn

Hi, boys and girls. I have a scritp that should be executed when the
user logs in via SSH. It's a shell script, a simple menu that execs
simple commands.

But if I try to execute it as it's shell (in /etc/passwd) or
auto-execute (in ~luser/.bashrc), the sftp connection fails saying
that "Received message too long 151605106".

Then, what I ask is: is there a way to manage a connection in a way
that I recognize when is it a sftp luser <at> host or a ssh <at> host, so I
execute the menu script only when ssh'ing?

Thanks in advance; I will try to do something with Subsystem option meanwhile...

-- 
Eduardo Costa Lisboa
--

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-chat
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Picon

Re: manage an sftp conn

That's pretty simple! I verify if the terminal is dumb. If it is, I
don't execute my script. Check it out:

if [ "$TERM" != "dumb" ]; then
        /usr/local/sbin/upload-menu
        exit
fi

on ~/.{profile,{bash{rc,_profile}}

-- 
Eduardo Costa Lisboa
--

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-chat
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page


Gmane