replace-su-with-sudo.sh 740 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
19
# Since we don't want to add 'su' function for root user, we will stop
# execution of this script if $USER is root.
20
[ "$USER" == "$LIVE_USERNAME" ] || return
21
22

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