I'm trying to script a gpg decryption, and as such need to provide the password on the command line. According to the man page, there are three ways to do this: read from a file using --passphrase-file, read from stdin (or another file descriptor) using --passphrase-fd 0, or include in the command line using just --passphrase. All of the above also require --batch to be set, which I did.  My most recent command line attempt is:  echo "&lt;password&gt;" | gpg2 --no-tty --batch --passphrase-fd 0 -d -o /&lt;path_to_destination&gt;/$FILE_NAME $FILE   which still pops up a dialog asking for the password. What am I missing here? For reference, if it makes a difference, my password does include some special characters like &amp;, but it doesn't appear to complain about that. Also, gpg version is 2.1.9:  # gpg2 --version gpg (GnuPG) 2.1.9 libgcrypt 1.7.1 Copyright (C) 2015 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt; This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.  Home: ~/.gnupg Supported algorithms: Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,         CAMELLIA128, CAMELLIA192, CAMELLIA256 Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224 Compression: Uncompressed, ZIP, ZLIB, BZIP2   EDIT: Unlike , which is simply trying to get a text-based password entry for use in a SSH session, I'm trying to get a completely non-interactive method of using GPG for use in scripting.
120646
Using gpg from a console-based environment such as ssh sessions fails because the GTK pinentry dialog cannot be shown in a SSH session.  I tried unset DISPLAY but it did not help. The GPG command line options do not include a switch for forcing the pinentry to console-mode.  Older GPG versions offered a text-based prompt that worked fine in SSH sessions but after the upgrade it just fails.  There is the --textmode command line switch but apparently, it does something else.  What would be the proper and clean way of getting plain-text pin entry for remote sessions?
54987
Heres the thread I'm bouncing off of:   So I'm trying to run this command: cd /etc/openvpn/easy-rsa; . ./vars; ./build-key username  However, after running that command, I need to input nothing [just press enter] 10 times, and press y twice. The user on the last thread suggested I use except, but I couldn't get it working. Here are the questions it asks:  root@suffice-vpn:/etc/openvpn/easy-rsa# ./build-key usernamtest Generating a 2048 bit RSA private key ..................+++ ........+++ writing new private key to 'usernamtest.key' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [US]: State or Province Name (full name) [NY]: Locality Name (eg, city) [Merrick]: Organization Name (eg, company) [IceWare]: Organizational Unit Name (eg, section) [IceWare]: Common Name (eg, your name or your server's hostname) [usernamtest]: Name [server]: Email Address [iceware@programmer.net]:  Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: Using configuration from /etc/openvpn/easy-rsa/openssl-1.0.0.cnf Check that the request matches the signature Signature ok The Subject's Distinguished Name is as follows countryName           :PRINTABLE:'US' stateOrProvinceName   :PRINTABLE:'NY' localityName          :PRINTABLE:'Merrick' organizationName      :PRINTABLE:'IceWare' organizationalUnitName:PRINTABLE:'IceWare' commonName            :PRINTABLE:'usernamtest' name                  :PRINTABLE:'server' emailAddress          :IA5STRING:'iceware@programmer.net' Certificate is to be certified until Jan 14 18:27:48 2026 GMT (3650 days) Sign the certificate? [y/n]:y   1 out of 1 certificate requests certified, commit? [y/n]y   As you can see, I press enter 8 times initially [to keep the default input] and then press enter another 2 times to skip the optional commands. Then, I need to press y twice. How can I automate this? I need to have this all happen in one command. Any suggestions? Thanks in advance.
80365
Is there a way to unlock and lock screen from command line, via ssh? I know /System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend command, but it doesn't seem to work via ssh. The perfect solution would be a command, that I could type logged via ssh and it would unlock the screen or lock it back again, so I don't need to tell anybody my password, if he wants to use it. Is there any builtin tool, that would provide such functionality?
39956
At work, I access both a remote system via SSH and some web interfaces that login through LDAP. I use 1password to manage my passwords, but I can't seem to find a simple way to input the password from the password manager to SSH. I saw sshpass but it can show the password in ps, which is really bad security, and also doesn't work in my case. Is there any way to input a password from an external program or script through SSH directly, or are there facilities within SSH that I can leverage and keep the passwords in sync? Such as keeping a key file that I unlock for SSH that has the same password, which is updated whenever I update the password. Note I can't directly use keys to log into the system because it's not built to support it.  Edit: One commenter pointed out that sshpass will show the password in ps, which is a no-go. I also can't directly alias ssh to something like sshpass ... ssh because I do still log into systems that use keys.   Edit 2: I got confirmation that a password manager is okay, and I attempted to use sshpass with a file descriptor to log into the server but it doesn't seem to work -- instead of giving me a prompt to enter my RSA token, I just get nothing, which makes me think it doesn't run through the same code and won't accept sshpass.
11355
I'm writing a C Shell program that will be doing su or sudo or ssh. They all want their passwords in console input (the TTY) rather than stdin or the command line.  Does anybody know a solution?  Setting up password-less sudo is not an option.   could be an option, but it's not present on my stripped-down system.
6700
A sample /etc/group file contains the following entries:  root:*:0: adm:!:4:logcheck antoine:x:1000:   The man pages I've read (Debian &amp; OSX) says the second field is to store a group password.  As they are rarely used, an asterisk * or a x is usually placed in it rather than leaving it blank.  The shadow man page also says that this second field should store the result of the crypt function.  And if an invalid result is stored (such as * or !) it means the password cannot be used as authentication method.  Does that hold true for the group file as well?  Why do I end up with 3 different characters in my group file all having the same meaning?  Can I safely change all to *?
39756
Having installed Ubuntu 11.10 with whole disk encryption and LVM, I need to provide a way for users to easily change LUKS passphrase.  Preferably, this should be done using GUI tools, thus, enabling novice users to perform this basic task.
70791
How can I  encrypt or scramble my shell script so that it's unreadable to the naked eye? Either method would be acceptable, please provide specific steps.
63793
I am lazy at home and use password authentication for my home machines. I am ready to move to key based authentication. There are many options on the web on how to do this, including catting then sshing the key over, scping the key over directly, etc.  I am looking for the easiest and recommended way to copy a key over, hopefully there is a convenience wrapper somewhere in the Ubuntu ssh package?  I'm already aware on .
50873
What is the best way of doing scp from one box to the other without prompting for password?  There are two servers:   Server A (10.152.2.10): /home/oracle/export/files.txt Server B (10.152.2.11): /home/oracle/import/   If I want to transfer the files using scp from server A to server B without being prompted to enter a password  [running this from Server A, /home/oracle/export/]  scp files.txt oracle@10.152.2.11:/home/oracle/import   This would prompt me for a password upon entering the command.  I understand that a keygen is required to be generated and copied to Server A. Thus [at server A]:  ssh-keygen -t rsa   This gives me two files stored in /home/oracle/.ssh:  id_rsa id_rsa.pub    1. Am I supposed to copy the two files (id_rsa, id_rsa.pub) over into server B /home/oracle/.ssh ?  While doing some google search on this, some articles mentioned about appending/concatenating this to authorized_keys.   2. Am I supposed to create this file on my own?  I seem to be confused on what is the right way to do this.  Btw, the two servers are running Suse Linux Enterprise Edition 9...
79709
I tried to create a user with password via ssh (with root permission) like this:  ssh root@123.45.6.7 useradd -p $(openssl passwd -1 1234) newuser   By doing so, I could successfully create an account named newuser, but I couldn't login with the expected password (which is 1234)  It makes no difference if I add double quotes:    ssh root@123.45.6.7 "useradd -p $(openssl passwd -1 1234) newuser"   And then I was wondering if I can generate hashed password and save it as a variable locally, but still with no luck.  password=$(openssl passwd -1 1234) ssh root@123.45.6.7 "useradd -p $password newuser"   Is there something that I miss? Thanks in advance!
32744
I am trying to set a master password from the terminal (using a shell script). I see the passwd function and the master.passwd function, however I don't see any documentation on either of these to set the master password (AFAIK, these set the user passwords only).  I am pulling my information from these sources:      My question is:  Can you use the passwd or master.passwd commands to set the master password? If so, can you please provide an example for how to accomplish this?
98707
Friends, I would like to specify my question a little bit, cause a lot of you give me suggestions that are already written in this page  www.ubuntu.com/download/how-to-verify  What confused me is that tip in the 2nd step, where it says :      Tip: On non-Linux systems, you might need to download the GPG tools for this next step. To check if you have the GPG tools installed, run the command gpg --version or gpg2 --version.   Now, it's not written WHERE do I have to write these commands. At the beginning in that page it says "These instructions assume basic knowledge of the command line", so I assumed I needed to open a "Command prompt" program for that, is it right ?  I don't understand why isn't it mentioned in that tip, it is really confusing for a newbie like me. And the results that I get when writing these commands in the "Command prompt" are confusing as well. But knowing that the gnuPG has never ever been installed on my laptop I don't expect too much more.  But still it would be good if it was written in that tip what you should see if it's not installed AND that from Windows OS you have to open a Command prompt program to write these commands in.   Previous question  I want to install Ubuntu on my laptop. I downloaded the iso image and now I want to verify it. I currently have Windows 7 as OS on my computer.   In this page www.ubuntu.com/download/how-to-verify in the 2nd step there is this tip that says:      Tip: On non-Linux systems, you might need to download the GPG tools for this next step. To check if you have the GPG tools installed, run the command gpg --version or gpg2 --version.   Now as I understand I need to write gpg --version when I open the command promt program is that right? I tried and it is unrecognized. But it's okay because I have never ever installed it on my laptop. The thing I worry a bit is am I doing it right? Do I need to use command prompt program for this?
37477
There're way too many articles/resources on the web that teaches people HOW to set the environment variable PATH so that they can use the short hand of java or python etc instead of the absolute path in command line interface.  What I'm interested to know is that what's behind the scene when we type in the command and hit enter (similar to ).  Here is my guess:   read the command (parse/preprocess stdin to get the right arguments $@) command lookup command execution (program started, consume memory, stdout/stderr to shell) re-render the emulator by relevant environment variables (e.g. $PS#, $PROMPT, etc)   The part I want to figure out most is the command lookup. Obviously, the $PATH is consumed by some background function and separated by : / ;as delimiters, then what happened? Do we use a hash table (key: basename of the file, value: absolute dirname of the file) to store the binary files under those PATHs, or some other hooks?   NOTE: I originally thought it was hash table as I can use [ -z hash [command] ] to check if a command is available in current env, but when I use hash | grep python I get nothing from the output while which python works as anticipated. (I think the mechanism might be shell specific, but I want to get more insights into it.)
63207
I've started taking security more seriously lately. (Why only now you may ask? Because I'm a trusting fool that's why.) I've now got emails signing automatically and encrypting where I have their key.   Previously I only did this when necessary, but I'm trying to breed a sense of change around me and taking my own medicine seems sensible. I have no issue with GPG in Thunderbird, Outlook, or on Android with K9 Mail &amp; APG, but I have no idea how to handle GPG on IOS.   I can't accept there's no way, it seems ridiculous, or maybe I'm approaching the problem wrong and there is a more appropriate route than GPG that's better supported?
32241
Is there a way to enter the default keyring password using the command line?   For instance:  You have a remote setup of Ubuntu 10.10 thats set to auto login. You don't want to remove  the keyring password.  All right the system boots up and logs in automatically, then asks for the keyring password now at this point you can create ssh connections but you can't remote desktop.   What can you do to enter the keyring password at this point?  Also, to better clarify, this is from a remote connection using the command line.
57646
Logging onto a machine over ssh typically requires a password to be entered before access is granted. Alternatively, a key/certificate (without a passphrase) can be installed onto the remote machine so that logging on no longer requires a password. This is particularly useful for automated or scripted solutions.  However, it is considered inadvisable and unsafe to create a key/certificate without a passphrase. Solutions involving ssh-add and ssh-agent are proposed as a means to enter a passphrase only once per session, but to still use a key/certificate with a passphrase.  What is the solution for automated connections between machines? How can a machine automatically update from a remote Bazaar repository (via bzr+ssh?) on a regular basis, as in a cron job? How can a machine automatically backup data from another machine (via rsync) as part of a cron job? rsyncd? This would not be  though, which is a major disadvantage. I haven't looked at Bazaar daemon/server options.