How to write ca-certificate via terminal in one line? [closed] - terminal

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 11 hours ago.
The community is reviewing whether to reopen this question as of 4 hours ago.
Improve this question
I am working with a mobile network module via AT commands.
HTTPS requests are working fine. However I do struggle to enter the ca-cert correctly.
I am quite certain that this is some simple fault of mine.
Normally the PEM encoded cert would be like this:
-----BEGIN CERTIFICATE-----
MIIFFjCCAv6gXXXXXXXRAJErCErPDBinU/bWLiWnX1owDQYJKoZIhvcNAQELBQAw
...
AoYWaHR0cDovL3gxLmkubGVuY3Iub3JnLzAnBgNVHR8EIDAeMBygGqAYhhZodHRw
-----END CERTIFICATE-----
So to make it a one-liner I transformed it to this:
-----BEGIN CERTIFICATE-----\nMIIFFjCCAv6gXXXXXXXRAJErCErPDBinU/bWLiWnX1owDQYJKoZIhvcNAQELBQAw\n...AoYWaHR0cDovL3gxLmkubGVuY3Iub3JnLzAnBgNVHR8EIDAeMBygGqAYhhZodHRw\n-----END CERTIFICATE-----\n
This was my attempt in sending the whole certificate in one string as needed by the module (Adrastea 1). I was using the given terminal tool by the manufacturer but also putty. In both cases I could not make to send multi-line AT commands. Neither with shift+Enter nor with a copied commands into Putty.
The feedback I get from the module is pretty narrow, it accepts the commmand itself with an OK, but this only means that the syntax of the command is correct, not specifically the certificate I provided. When I try to request an HTTPS website afterwards the module crashes and restart, so there should be definetly something wrong with the way I inserted the certificate.
This is the whole command I send to write the cert to a file. I shorted and changed the certificate of course
AT%CERTCMD="WRITE","certificate1.pem",0,\r\n"-----BEGIN CERTIFICATE-----\nMIIFFjCCAv6gAwIBAgIRAJErCErPDBinU/bWLiWnX1owDQYJKoZIhvcNAQELBQAw\nPTNlclQtgaDqw+34IL9fzLdwALduO/ZelN7kIJ+m74uyA+eitRY8kc607TkC53wl\n-----END CERTIFICATE-----\n"

Related

How to use a GPG key for SSH on macOS [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 days ago.
Improve this question
Basically, my goal is to use a single key for everything. I have a GPG key that I imported onto my MacBook, and would like to use that key for SSH authentication. However, despite my several attempts, I cannot get my key to list. I have, for the most part, been following the guide here: https://gregrs-uk.github.io/2018-08-06/gpg-key-ssh-mac-debian/ trying minor variations to see if it would have an impact. But when I run ssh-add -l I get the customary "The agent has no identities."
I notice the guide is relatively old (written in 2018), so has anyone had success with using a GPG key for SSH on Mac? Is it simply a lost cause? Any help would be much appreciated!
Added enable-ssh-support to my gpg-agent.conf file
Added the GPG key keygrip to my sshcontrol file
Added:
export GPG_TTY=$(tty)
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
gpgconf --launch gpg-agent
to my .zprofile (I suspect this is where the issue lies)
And still nothing after running ssh-add -l

not able to open PuTTy key generator [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I am really new to Putty and Puttykey generator as I am trying to setup EC2 on AWS. I have managed to install PuTTy on my Mac, and PuTTy works fine, but every time I click on PuTTykey Generator I see a message (please see the snap attached) and no pop up window. how do I get it to work? I have Mac Mojave.
the reason why you use puttygen is to generate the ssh-key pair especially on windows systems. You don't generally need to use putty key generator on mac since Mac OS has a built-in command-line SSH client known as Terminal.
To use terminal, go to Finder and then click the menus Go -> utilities from the top menu. After that find the terminal which supports SSH connections to remote servers.
You can run ssh-keygen to generate an ssh key pair.
ssh-keygen
reference (how to use ssh-keygen to generate a keypair):
https://www.digitalocean.com/docs/droplets/how-to/add-ssh-keys/create-with-openssh/
I am not sure about the reason why you are trying to use puttygen through.
If you simply like to login to your ec2 instance via ssh (using the keypair from ec2), you can use ssh command as below.
ssh -i `~/Downloads/my.pem` ec2-user#[ip-address]
by the way, The reason why you are seeing an output like the one you shared is, when you run puttygen is, it's a command line utility and it's expecting some mandatory command line arguments to be passed.

OverTheWire wargame server "added as a known host"? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 4 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I have been using OvertheWire terminal coding wargame and i have accedentally
ssh'ed the server and it said in the describtion that i there is no ssh.
this message appeared
Permanently added 'natas0.natas.labs.overthewire.org' (ECDSA) to the list of known hosts.
what should i do so im not a host and what does it mean that im a host?
A "host" in this context means server, and it's talking about the server you were connecting to, not your machine.
On your machine, there is a file called known_hosts. This contains the ssh "fingerprints" of every server that you have connected to.
The first time you connect to a new server, ssh records the fingerprint. This is important, because it means ssh can detect someone spoofing the server in the future (by warning you that you are connecting to a different server from last time). Typically, users see this warning when the server is upgraded or moved to a new datacentre, rather than when something untoward is happening.
Your message is just saying that your ssh client has recorded the server fingerprint to allow you to check that you're connecting to the same server the next time you ssh to it. My guess is the server that you connected to accepted your ssh connection, but used it to print a message saying that ssh was not available.
If you want to remove the fingerprint from your system, you can can open that file and remove the line that describes the wargame server. However, I doubt there is any risk from keeping the fingerprint.
If you want to do this this:
On a mac or a unix/linux system, the file will be in ~/.ssh/known_hosts. Open it up, remove the line that describes the wargame server, and then save the file.
On a windows machine using putty, you will need to edit the registry to remove the hosts:
Open up ‘regedit.exe’ by doing a search.
Navigate to HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys
Delete the host key for the wargame server.

How to setup SSH keys on local computer terminal using Windows when my server is Ubuntu? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 7 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
So I am in the process of setting up my own server for the first time using Vultr and I'm following a guide from DigitalOcean. The server is on Ubuntu but I am using Windows 10. I've been doing everything through the console that's logged into my server but now I'm trying to generate SSH keys locally and I'm not quite sure how to do this. I'm pretty new to this and I don't know if this is easily done through Windows 10. The tutorial states..
Generate a Key Pair
If you do not already have an SSH key pair, which consists
of a public and private key, you need to generate one.
If you already have a key that you want to use,
skip to the Copy the Public Key step.
To generate a new key pair, enter the following command at the
terminal of your local machine (ie. your computer):
local$ ssh-keygen
Assuming your local user is called "localuser",
you will see output that looks like the following:
ssh-keygen output
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/localuser/.ssh/id_rsa):"
I can do all this on the terminal I use that's logged in to my server but I can't figure out how to do this locally on my computer. Any help would be appreciated. Thanks.
You could install Cygwin, and get the openssh command-line utilities via its installer. That might be more involvement than you want with Windows.
The easier way would be to install PuTTY, use the puttygen utility to create a PuTTY private key. You can export the public key in openssh format, and use it on your server. (puttygen does the same function as ssh-keygen, using a GUI - but PuTTY's key format is different...)
DigitalOcean has a page on that: How To Create SSH Keys with PuTTY to Connect to a VPS

correct use of path in win2008 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
This question does not appear to be about programming within the scope defined in the help center.
Improve this question
I have an application in Delphi 5 and up right now works very well in a workgroup network. but recently installed a win 2008 server and active directory and the problem is that now I can not access files on Win Server 2008. I found that the problem is that I give the path is composed of the IP of the server and the file name. something is not configured properly in win2008 or I'm not addressed either the name of the file?
example
type 192.168.0.200:C:\aaa010101aaa_csd_01.key
The file name, directory, or volume label sintax is incorrect.
original code does not work
OpenSSL.exe pkcs8 -inform DER -in "192.168.0.200:C:\SISTEMA NIUX\aaa010101aaa_CSD_01.key" -passin pass:a0123456789 -out "192.168.0.200:C:\SISTEMA NIUX\pkey.key.pem"
That's not a valid file path for Windows of any version. You need to first make sure that C: is shared and that you're logged in with a valid account on that machine, and then use a proper UNC filename. Presuming that C:\SISTEMA NIUX is the folder the file is in, the proper path to the file would be something like:
"\\192.168.0.200\C\SISTEMA NIUX\aaa010101aaa_csd_01.key"
Note that if there isn't a specific share set up, you'll need to use the default admnistrative share, which means adding a dollar sign ($) after the drive letter:
"\\192.168.0.200\C$\SISTEMA NIUX\aaa010101aaa_csd_01.key"

Resources