Find the answer to your Linux question:
Results 1 to 5 of 5
I wrote a Small BashScript that encrypts a Directory using tar and gpg. It runs fine on LocalHost but if called over VNC -> SSH I get a problem. The ...
  1. #1
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422

    Bash Script works, but fails duing SSH/VNC Session

    I wrote a Small BashScript that encrypts a Directory using tar and gpg.
    It runs fine on LocalHost but if called over VNC -> SSH I get a problem.
    The Problem code is:
    Code:
    tar cf $1.tar $1  <-Here I make a tar file of the Directory
    gpg -c $1.tar     <-Here I Encrypt the tar file
    Anyhow, the Error I get is:
    Code:
    gpg: cannot open `/dev/tty': No such device or address
    Can anyone tell me why that is? Why does it want to use /dev/tty? (It doesnt have that since its a OpenVZ box.
    But then again, why should he have access to tty?
    And why does it work on Localhost but not during a SSH session?

    Thanks already.
    New Users, please read this..
    Google first, then ask..

  2. #2
    Linux Enthusiast likwid's Avatar
    Join Date
    Dec 2006
    Location
    MA
    Posts
    649
    Well I believe this happens because gpg uses the terminal as a source of entropy. There is a --no-tty option for gpg, but I've never actually had to use it, and from the manpage it looks like it may only be for output. It's worth trying out I'd say though

  3. #3
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    THANKS!
    I did try man gpg but I did read that you only may use one command..
    Anyhow, I get
    Code:
    gpg: Sorry, no terminal at all requested - can't get input
    now I changed it to:
    Code:
    gpg -c --no-tty $1.tar
    New Users, please read this..
    Google first, then ask..

  4. #4
    Linux Enthusiast likwid's Avatar
    Join Date
    Dec 2006
    Location
    MA
    Posts
    649
    I did a test and found it prompts for a passphrase, cause you have to sign it with a key- i think -u is the option. Do gpg --list-keys to see which ones you've got.

  5. #5
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    Thanks
    But I decided to go back to OpenSSL for Singel File Encryption.
    It has a stronger Algorytmn. (Since its done by 6 / 8 Character Passwords instead of 256 / 512 bit keys)
    Anyhow, thanks.

    Cheers,
    Robin
    New Users, please read this..
    Google first, then ask..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...