Try ssh -t -t
(or ssh -tt
for short) to force pseudo-tty allocation even if stdin isn’t a terminal.
See also: Terminating SSH session executed by bash script
From ssh manpage:
-T Disable pseudo-tty allocation. -t Force pseudo-tty allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g. when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty.
Related Posts:
- Pseudo-terminal will not be allocated because stdin is not a terminal
- “sed” command in bash
- Given two directory trees, how can I find out which files differ by content?
- ./configure : /bin/sh^M : bad interpreter
- What is the difference between “#!/usr/bin/env bash” and “#!/usr/bin/bash”?
- Is there a “goto” statement in bash?
- Writing a simple shell in C using fork/execvp
- chmod: changing permissions of ‘my_script.sh’: Operation not permitted
- What does set -e mean in a bash script?
- What does set -e mean in a bash script?
- How do I know the script file name in a Bash script?
- What is “-bash: !”: event not found”
- Keeping a linux process running after I logout
- How to add a timestamp to bash script log?
- Colors in bash after piping through less?
- How to run command as user who has /usr/sbin/nologin as Shell?
- Can you have more than one ~/.ssh/config file?
- SSH from A through B to C, using private key on B [closed]
- How can I fully log all bash scripts actions?
- How do I deal with a filename that starts with the hyphen (-) character?
- Bash: No such file or directory?
- Why do you need to put #!/bin/bash at the beginning of a script file?
- “Couldn’t find a file descriptor referring to the console” on Ubuntu bash on Windows
- gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now
- How can I recursively find all files in current and subfolders based on wildcard matching?
- subprocess.Popen(): OSError: [Errno 8] Exec format error in python?
- How to substitute shell variables in complex text files
- -bash: syntax error near unexpected token `newline’ for display command
- How can I recursively find all files in current and subfolders based on wildcard matching?
- How do I use grep to search the current directory for all files having the a string “hello” yet display only .h and .cc files?
- Curl command for https ( SSL )
- How to exclude a directory in find . command
- How to exclude a directory in find . command
- mysql_config not found when installing mysqldb python interface
- Shell command to tar directory excluding certain files/folders
- Explaining the ‘find -mtime’ command
- How does “cat << EOF" work in bash?
- ssh: Could not resolve hostname [hostname]: nodename nor servname provided, or not known
- X11 forwarding request failed on channel 0
- How can I kill a process by name instead of PID, on Linux?
- Extract file basename without path and extension in bash
- mv: cannot stat error : No such file or directory error
- mysql_config not found when installing mysqldb python interface
- Diff command along with Grep gives “Binary file (standard input) matches”
- screen Cannot open your terminal ‘/dev/pts/0’ – please check
- How to download a file from server using SSH?
- Trying to use bash on Windows and got no installed distributions message
- Bash script: bad interpreter
- connect to host localhost port 22: Connection refused
- Implementing shell in C and need help handling input/output redirection
- How to count lines in a document?
- What does `set -x` do?
- Command to change the default home directory of a user
- How to specify the private SSH-key to use when executing shell command on Git?
- How to get the process ID to kill a nohup process?
- Implementation of multiple pipes in C
- Getting stty: standard input: Inappropriate ioctl for device when using scp through an ssh tunnel
- What does “&” at the end of a linux command mean?
- tar: add all files and directories in current directory INCLUDING .svn and so on
- Syntax error near unexpected token ‘then’
- “find: paths must precede expression:” How do I specify a recursive search that also finds files in the current directory?
- Copy multiple files from one directory to another from Linux shell
- Bash script prints “Command Not Found” on empty lines
- How to use sed to extract substring
- Pipe to/from the clipboard in a Bash script
- Linux Bash: Move multiple different files into same directory
- How do I write stderr to a file while using “tee” with a pipe?
- How to enable Bash in Windows 10 developer preview?
- EC2 ssh Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
- What does ‘bash -c’ do?
- bash sh – command not found
- How to configure WP filesystem access in Linux (Ubuntu Server)?
- How can I sort du -h output by size
- What are the functional differences between .profile .bash_profile and .bashrc
- Can I automatically add a new host to known_hosts?
- Can I nohup/screen an already-started process?
- Permission denied (publickey). SSH from local Ubuntu to Amazon EC2 server
- How to run a command multiple times, using bash shell?
- Shell command to monitor changes in a file
- Is it normal to get hundreds of break-in attempts per day?
- How to reconnect to a disconnected ssh session
- how to disable SSH login with password for some users?
- How do I prevent accidental rm -rf /*?
- What’s the best way to check if a volume is mounted in a Bash script?
- How to check if an RSA public / private key pair match
- how do you create an ssh key for another user?
- Linux command line best practices and tips?
- “POSSIBLE BREAK-IN ATTEMPT!” in /var/log/secure — what does this mean?
- How to get pid of just started process
- Show all users and their groups/vice versa
- SSHFS mount that survives disconnect
- Temporarily ignore my `~/.ssh/known_hosts` file?
- What’s wrong with always being root?
- Is there a way to do a remote “ls” much like “scp” does a remote copy?
- Hundreds of failed ssh logins
- How to apply a filter to real time output of `tail -f `?
- protocol version mismatch — is your shell clean?
- How to remove invalid characters from filenames?
- zcat/gzcat works in linux, not on osx. general linux/osx compatibility
- How do I join two named pipes into single input stream in linux