Recently I got into an interesting issue: I had to find a way to provide a menu when a user would log in into the machine, but without prohibit it to enter via sftp too. If I used /usr/local/bin/menu.sh as the main shell sftp would not work showing a error endind the connection. So, how to fix that? After some tests I just find out that a sftp connection is a terminal, just like any other ssh session, but with a difference: it's a dumb terminal. So, what I did was to put this code on my ~/.bashrc file - in the case, using /bin/bash as the main shell:
--- /home/user/.bashrc
...
if [ "$TERM" != "dumb" ]; then
/usr/local/sbin/upload-menu
exit
fi
...
--- eof
That's all for today :-).
Using menus on users' login More Login
Using menus on users' login
Slashdot Top Deals