Recommended VPS Complete list of best VPS hosting providers.

How to Fix Rsync “stdin: is not a tty” error

Just recently I tried to establish an SSH connection from my VPS to a Shared Hosting environment trying to download some backup files via rsync. The process went not so smooth, it was successful but with one error notification: stdin: is not a tty.

This time I will not explain about rsync but simply how to get rid that error message so it won’t hogging your log file.

How could such error occur? This is most likely because your remote shell is trying to execute something which needs to run interactively but when you are most likely not in an interactive mode.

How to fix this issue?

Step 1 – Login to your server (remote / local) where you wish to run rsycn or where you wish to establish the ssh from.

Step 2 – Next go to the home directory of your user account.

For example, if you are logging in as root, then go to /root or simply use cd ~ command.

cd ~

but if you are logging in as another user go to home directory of that user which usually at /home/username.

cd /home/username

of course you have to replace username with your own.

But normally, each time you logged in, you should be automatically be in that user home directory.

Step 3 – Edit a file named .bashrc using either nano or vi.

nano .bashrc

pic:

2014-01-27_201345

Step 4 – Now add these lines below to the top of your .bashrc file:

[ -z "$PS1" ] && return

pic:

2014-01-27_201931

Step 5 – Now save that file and exit. In nano you can simply hit Control+O to save then Control+X to exit.

That’s it. Now your ssh connection will never again encounter “stdin: is not a tty” error.

7 Comments

Add a Comment

Your email address will not be published. Required fields are marked *

Get more stuff like this
in your inbox

Subscribe and get interesting stuff plus faster updates to your email.