Improve how I detect login for ssh
This commit is contained in:
3
do.sh
3
do.sh
@@ -7,8 +7,9 @@ ssh_clean ()
|
|||||||
|
|
||||||
ssh_exec ()
|
ssh_exec ()
|
||||||
{
|
{
|
||||||
|
login=$(git config user.name || echo $USER)
|
||||||
export SSHPASS="${SSHPASS-Born2beRoot}"
|
export SSHPASS="${SSHPASS-Born2beRoot}"
|
||||||
./ssh.exp -p 4242 ${USER}@127.0.0.1 $@ 2>&1 \
|
./ssh.exp -p 4242 ${login}@127.0.0.1 $@ 2>&1 \
|
||||||
| grep -v -i -e '^Warning: Permanently added' -e ' password:' -e '^spawn ssh'
|
| grep -v -i -e '^Warning: Permanently added' -e ' password:' -e '^spawn ssh'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
3
sudo.sh
3
sudo.sh
@@ -7,8 +7,9 @@ ssh_clean ()
|
|||||||
|
|
||||||
ssh_sudo ()
|
ssh_sudo ()
|
||||||
{
|
{
|
||||||
|
login=$(git config user.name || echo $USER)
|
||||||
export SSHPASS="${SSHPASS-Born2beRoot}"
|
export SSHPASS="${SSHPASS-Born2beRoot}"
|
||||||
./ssh_sudo.exp -p 4242 ${USER}@127.0.0.1 sudo $@ 2>&1 \
|
./ssh_sudo.exp -p 4242 ${login}@127.0.0.1 sudo $@ 2>&1 \
|
||||||
| grep -v -i -e '^Warning: Permanently added' -e 'password' -e '^spawn ssh' -e 'Connection to'
|
| grep -v -i -e '^Warning: Permanently added' -e 'password' -e '^spawn ssh' -e 'Connection to'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user