Forgot your password?
typodupeerror
User Journal

Journal lisboa's Journal: Using menus on users' login

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 :-).

This discussion has been archived. No new comments can be posted.

Using menus on users' login

Comments Filter:

The universe does not have laws -- it has habits, and habits can be broken.

Working...