Tag Archives: RSA

Daniel Silverstone: What, another one? Project Euler problem 89…

Yes, yet another live-coding exercise in Haskell to solve Project Euler problem 89 this time.

I promise that this is the penultimate of these problems. I have one more, based on RSA which I will be doing tomorrow night (and possibly the following night if it’s too hard for 15 to 20 minutes) and then I have another project to go on the channel. Email suggestions please 🙂

…read more
Source: FULL ARTICLE at Planet Ubuntu

SSH on a Shell Script

By mathbalaji

Hello,

I’m sure you’d have received a lot of questions like this, but I couldn’t find anything relevant to my problem in the first search. Sorry in advance if this is a repeated question.

I’m trying to do an SSH inside a shell script and expect the shell script to connect to a remote server (for deleting a few files and another script for reboot). I have the following challenges:

1. I know the username/password for the remote server, but I cannot pass it via terminal.
2. I’ve done the RSA authentication in the past, but the server where I’m writing the script doesn’t have RSA authentication enabled (in the

Code:

/etc/ssh/sshd_config


file). So, creating the

Code:

ssh-keygen


and pasting the public key inside authorized_keys doesn’t work for me.
3. I don’t have

Code:

spawn


or

Code:

sshpass


command in the server. When I try these commands, the terminal says unknown command.

I guess there’s no way I can write the script here! Let me know if you think otherwise!

OS: GNU Linux

PS: This is my first question here!

Thanks,
B.

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Multi-factor authentication

By lupin..the..3rd

Is anyone here familiar with implementing multi-factor authentication on HP-UX 11.31? Either with a PIV card, or with an RSA token? We’ve been tasked with implementing this on our servers, but I’m not finding much in the way of products or information. To complicate matters, our servers are running in Trusted Mode.

Any leads are appreciated, thanks.

…read more
Source: FULL ARTICLE at The UNIX and Linux Forums

Dmitrijs Ledkovs: Android Debug Bridge (adb) update for 4.2.2

To use adb against android 4.2.2 device one needs updated adb tool. This is now published in raring archive. If you are using quantal or precise, there is a backport published in the usual location of the nexus7-installer.
add-apt-ppa -y ppa:ubuntu-nexus7/ubuntu-nexus7-installer
Here are the instructions about the new adb from the android development website:

When you connect a device running Android 4.2.2 or higher to your computer, the system shows a dialog asking whether to accept an RSA key that allows debugging through this computer. This security mechanism protects user devices because it ensures that USB debugging and other adb commands cannot be executed unless you’re able to unlock the device and acknowledge the dialog. This requires that you have adb version 1.0.31 (available with SDK Platform-tools r16.0.1 and higher) in order to debug on a device running Android 4.2.2 or higher.

 — ADB 

…read more
Source: FULL ARTICLE at Planet Ubuntu

Dustin Kirkland: ssh-import-id now supports -r|–remove keys

As a brief followup to my recent post about ssh-import-id now supporting Github in addition to Launchpad, I should also mention that I’ve also added a new feature for removing keys that were previously imported.

Here’s an example, importing kirkland’s public keys from Launchpad.

kirkland@x220:~$ ssh-import-id lp:kirkland
2013-02-15 14:53:46,092 INFO Authorized key ['4096', 'd3:dd:e4:72:25:18:f3:ea:93:10:1a:5b:9f:bc:ef:5e', 'kirkland@x220', '(RSA)']
2013-02-15 14:53:46,101 INFO Authorized key ['2048', '69:57:f9:b6:11:73:48:ae:11:10:b5:18:26:7c:15:9d', 'kirkland@mac', '(RSA)']
2013-02-15 14:53:46,102 INFO Authorized [2] SSH keys

And now let’s remove those keys…

kirkland@x220:~$ ssh-import-id -r lp:kirkland
2013-02-15 14:53:49,528 INFO Removed labeled key ['4096', 'd3:dd:e4:72:25:18:f3:ea:93:10:1a:5b:9f:bc:ef:5e', 'kirkland@x220', '(RSA)']
2013-02-15 14:53:49,532 INFO Removed labeled key ['2048', '69:57:f9:b6:11:73:48:ae:11:10:b5:18:26:7c:15:9d', 'kirkland@mac', '(RSA)']
2013-02-15 14:53:49,532 INFO Removed [2] SSH keys

Neat!

So the way this works is that ssh-import-id now adds a comment to the end of each line it adds to your ~/.authorized_keys file, “tagging” the keys that it adds.  When removing keys, it simply looks for keys tagged accordingly.

Enjoy!

:-Dustin …read more
Source: FULL ARTICLE at Planet Ubuntu

SSH/RSAAuthentication Problems

By Nvizn

I’m attempting to setup RSA Authentication for a particular user on two servers. A script runs via crontab, logs into one server and transfers data from the server1 to server2. Another script via cron, runs on server2, connects to server 1 and transfers data to it. However, I’m having issues configuring ssh/RSA authentication. An RSA key was generated on server1, then id_rsa.pub was copied to server2 in authorized_keys.

Here’s my debug results:

Code:

[user@server1 .ssh]$ ssh -v -l user server2
Sun_SSH_1.1.4, SSH protocols 1.5/2.0, OpenSSL 0x0090704f
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug1: ssh_connect: needpriv 0
debug1: Connecting to server2 [XXX.XXX.XX.XXX] port XX.
debug1: Connection established.
debug1: identity file /export/home/user/.ssh/identity type -1
debug1: identity file /export/home/user/.ssh/id_rsa type 1
debug1: identity file /export/home/user/.ssh/id_dsa type -1
debug1: Logging to host: server2
debug1: Local user: user Remote user: user
debug1: Remote protocol version 2.0, remote software version Sun_SSH_1.1.4
debug1: match: Sun_SSH_1.1.4 pat Sun_SSH_1.1.*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-Sun_SSH_1.1.4
debug1: use_engine is 'yes'
debug1: pkcs11 engine initialized, now setting it as default for RSA, DSA, and symmetric ciphers
debug1: pkcs11 engine initialization complete
debug1: Failed to acquire GSS-API credentials for any mechanisms (No credentials were supplied, or the credentials were unavailable or inaccessible
Unknown code 0
)
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: Peer sent proposed langtags, ctos: en-CA,en-US,es,es-MX,fr,fr-CA,i-default
debug1: Peer sent proposed langtags, stoc: en-CA,en-US,es,es-MX,fr,fr-CA,i-default
debug1: We proposed langtags, ctos: i-default
debug1: We proposed langtags, stoc: i-default
debug1: Negotiated lang: i-default
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: Remote: Negotiated main locale: C
debug1: Remote: Negotiated messages locale: C
debug1: dh_gen_key: priv key bits set: 133/256
debug1: bits set: 1587/3191
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'server2' is known and matches the RSA host key.
debug1: Found key in /export/home/user/.ssh/known_hosts:2
debug1: bits set: 1638/3191
debug1: ssh_rsa_verify: signature correct
debug1: newkeys: mode 1
debug1: set_newkeys: setting new keys for 'out' mode
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: newkeys: mode 0
debug1: set_newkeys: setting new keys for 'in' mode
debug1: SSH2_MSG_NEWKEYS received
debug1: done: ssh_kex2.
debug1: send SSH2_MSG_SERVICE_REQUEST
debug1: got SSH2_MSG_SERVICE_ACCEPT
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive
debug1: Next authentication method: gssapi-keyex
debug1: Next authentication method: gssapi-with-mic
debug1: Failed to acquire GSS-API credentials for any mechanisms (No credentials were supplied, or the credentials were unavailable or inaccessible
Unknown code 0
)
debug1: Next authentication method: publickey
debug1: Trying private key: /export/home/user/.ssh/identity
debug1: Trying public key: /export/home/user/.ssh/id_rsa
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,publickey,password,keyboard-interactive
debug1: Trying private key: /export/home/user/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
Password:


Source: FULL ARTICLE at The UNIX and Linux Forums