replace-su-with-sudo.sh 675 Bytes
Newer Older
1
2
#!/bin/bash

3
4
5
6
7
8
# Replace su by a message to use sudo.
#
# In Tails, the administration password doesn't work with 'su'. New
# users in particular may be puzzled by the authentication failures
# while trying to 'su' using administration password.
#
9
10
# This script introduces 'su' function for non-root users. The 'su'
# function executes '/usr/local/bin/replace-su-with-sudo', which asks
11
12
# them to use 'sudo' instead of 'su'.
#
13
14
# https://redmine.tails.boum.org/code/issues/15583

15
16
17
# Get LIVE_USERNAME
. /etc/live/config.d/username.conf

18
# Only add the 'su' function for the desktop user.
19
[ "$USER" == "$LIVE_USERNAME" ] || return
20
21

su (){
22
    /usr/local/bin/replace-su-with-sudo
23
}