Phenomenon:
Need to log on to a target machine on the line a, but not directly login (no login rights), you need to log on to the B machine, and then jump from the B machine to a machine.
The script is as follows:
localhost:~ root# Cat idc-7.sh
#!/bin/bash
SSH [email protected] "ssh-p25791 [email protected]"
But the error when executing the script is as follows:
Pseudo-terminal won't be allocated because stdin
Reason:
The pseudo-terminal will fail to allocate because the standard input is not a terminal.
Workaround:
the-T-T parameter needs to be increased to force pseudo-terminal allocations, even if the standard input is not a terminal. Add the-t-t parameter to the script, as follows:
localhost:~ root# Cat idc-7.sh
#!/bin/bash
SSH [email protected] "ssh -t-t -p25791 [email protected]"
Or
localhost:~ root# Cat idc-7.sh
#!/bin/bash
SSH- t [email protected] "ssh -t-t -p25791 [email protected]"
SSH Login failed, error: Pseudo-terminal won't be allocated because stdin