diff --git a/etc/sudo-sftp b/etc/sudo-sftp deleted file mode 100755 index aa9393c..0000000 --- a/etc/sudo-sftp +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -exec sudo sftp "$@" diff --git a/etc/sudo-sftp b/etc/sudo-sftp new file mode 120000 index 0000000..ca56047 --- /dev/null +++ b/etc/sudo-sftp @@ -0,0 +1 @@ +sudo-ssh \ No newline at end of file diff --git a/etc/sudo-ssh b/etc/sudo-ssh index 0757ec0..daef97f 100755 --- a/etc/sudo-ssh +++ b/etc/sudo-ssh @@ -1,2 +1,7 @@ #!/bin/bash -exec sudo ssh "$@" +proc=$(basename $0 | sed 's|sudo-||') +parent=$(cat /proc/$PPID/comm) +if [ "$parent" = "sshpass" ]; then + exec $proc "$@" +fi +exec sudo $proc "$@"