Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Apr 2003
    Location
    Houston, TX
    Posts
    378
    cPanel/Enkompass Access Level

    Root Administrator

    Default "is not a tty" on scp (or other non-interactive ssh sessions)

    Had the following input from a customer that was very handy so wanted to suggest it:

    when you scp a file to the server it completes the copy but also responds with:
    stdin: is not a tty

    This is because scp runs ~/.bashrc and ~/.bashrc calls the global bashrc at /etc/bashrc. The global bashrc has commands that are only applicable if this is an interactive session and, since scp isn't an interactive session, then these commands don't run properly and result in the above error message.

    To solve this I've added this to the top part of my ~/.bashrc :-

    if [ $(expr index "$-" i) -eq 0 ]; then
    return
    fi

    If it's an interactive session the $- contains "i". If $- doesn't contain an "i" then the session isn't interactive and the processing of .bashrc ends here (i.e. before it calls the global bashrc) and so no error is generated.

  2. #2
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Sep 2007
    Posts
    139

    Default

    I dont really see cpanel doing anything to fix this because it is not something caused by their software. You should be able to create a custom .bashrc file and put it in the skeleton directory so that it gets copied to new accounts when they are created.

Similar Threads & Tags
Similar threads

  1. Replies: 1
    Last Post: 06-11-2010, 01:29 PM
  2. "Remote scp sent illegal error code" and slow SSH connection
    By Brook in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 07-18-2009, 08:22 PM
  3. "Status Warning" - SSH continually restarting after port change
    By n000b in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 09-04-2007, 05:44 PM
  4. Change the "Always redirect users to the ssl/tls ports" from Ssh
    By equens in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 03-31-2007, 05:55 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube