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

su (){
20
    /usr/local/bin/replace-su-with-sudo
21
}