Copying my answer from the same question @javabrett pointed out:
You were well advised not to change your startup scripts, specially ~/.bashrc
. Any "terminal detection" using current $TERM
or $COLORTERM
in ~/.profile
is merely a guess, and may, as you said, cause trouble when using other terminals (say, Putty or xterm). The terminal emulator is supposed to set $TERM
, and this should not be changed from within the shell.
Gnome terminal, AFAIK, does not offer a configuration to change its TERM
, but it does allow you to change your startup command, and that's all you need. Here is the trick:
Profile Preferences => Title and Command => Run a custom command instead of my shell
Then use the following command:
env TERM=xterm-256color /bin/bash
Just replace /bin/bash
with your preferred shell if it's different. And no, you can't use "$SHELL"
in that line for shell auto-detection ;) You have to hard-code it
Turns out that setquota doesn't mean anything at that stage, so you have to use the complete path to call it (/usr/sbin/setquota).
Also, as expected, it doesn't like the samba name. Which can be fixed by using
quota_user =`id -u ${PAM_USER}`
/usr/sbin/setquota -u ${quota_user} 0 10485760 0 0 /data
Best Answer
You can create a normal user with the
useradd
command. After you added the user, you should be able to let the password expire with:passwd --expire USERNAME
.Now the user has to change the password on the next login.