Questions tagged [key-authentication]

Questions pertaining to key authentication, a type of authentication that may be used as an alternative to password authentication. Instead of requiring a user's password, it is possible to confirm the client's identity by using asymmetric cryptography algorithms, with public and private keys.

Filter by
Sorted by
Tagged with
0 votes
1 answer
36 views

Log in to remote server by using a generated public key

I have a zsh script in which I logged to a remote host want to copy some folders. The system asks me each time to give the password of local host which I want to bypass otherwise I have to enter the ...
ecjb's user avatar
  • 379
0 votes
0 answers
40 views

SSH Keys Not Recognized?

I have two Debian (11 and 12) systems. I'm trying to verify ssh access from server A to server B via keys, following this video https://www.youtube.com/watch?v=vINn1MIrf7o. I try to use the keys, ...
Rez's user avatar
  • 1
-1 votes
1 answer
49 views

Why git authentications works through SSH keys?

Question in the title, but let me detail more. Excluding the ID/Password method on git CLI, we generate a SSH key and add the public key to the remote server. Why don't we have SSH-less public-key ...
brm1911's user avatar
1 vote
2 answers
39 views

Can two linux users share .ssh folder keys to connect to an SSH server

I have two linux users user1 - regular account with auth key stored in /home/user1/.ssh/ user2 - service account without home directory How can user2 access user1's keys to connect to the remote ...
try.aaam's user avatar
0 votes
1 answer
16 views

I try to copy a file from a GCP instance to my local machine, but powershell gives me a "Permission denied: (publickey)"

I created a GCP instance, and I created a private and public key on kali linux, I saved this key in the metadata of GCP, so I can access the instance through my kali machine. Then, I need to copy a ...
Christian Ramírez's user avatar
3 votes
2 answers
637 views

SSH host key not recognized

At my new hosting provider, they allowed SSH for my account, but they only sent me port, server address, username, password, but no key. When I try to log in with PuTTY, it logs in, but I get the ...
bencuri's user avatar
  • 31
0 votes
0 answers
27 views

Is the key in ~/.ssh/known_hosts different from the ssh public key of the remote host?

I believe it is because at this point, the remote host has not even necessarily generated an ssh key. This phase is during server authentication, in which I believe that the remote server gives a ...
displayname12345's user avatar
0 votes
1 answer
20 views

How to change the private key passphrase in lsh?

info lsh manual covers how to create a keypair and protect the private key with a passphrase. The manual does not tell how to change the passphrase or how to decode the private key, which is stored as ...
Roman Riabenko's user avatar
0 votes
2 answers
122 views

ProxyJump in login->compute node still requires password

I want to ssh from LAPTOP to COMPUTE but have to go through LOGIN, and COMPUTE and LOGIN share users (so no separate ssh configs). This question is similar to this one with the exception that in my ...
Bram Vanroy's user avatar
1 vote
2 answers
530 views

How can I encrypt a password in a bash script?

I created a shell alias that runs a simple shell script. The script is shown below, it sshs into another Linux machine: #!/bin/bash sshpass -p 'P@ssw0rd' ssh username@hostname I would like to encrypt ...
OpenSourceSingh's user avatar
0 votes
1 answer
647 views

How do I convert an OpenSSH-generated ED25519 key to the PEM format?

I am trying to convert an OpenSSH-generated private host key to the PEM format, so that I can use it also in dropbear-initramfs. However, when trying to do so using the ssh-keygen program, I am ...
liori's user avatar
  • 612
-1 votes
1 answer
113 views

SSH: Use key-pair authentication, but if not present default to password

I am hoping to find a way to configure our systems so that it will work with ssh-key-pair authentication, but if not present, fail over to requiring a password, and fail login if incorrect password is ...
jewettg's user avatar
  • 107
0 votes
0 answers
122 views

SFTP nologin user public key auth will not work

Here is the user's configuraitons cat /etc/passwd | grep sftp sftpadmin:x:1001:1001::/backups:/sbin/nologin Created directory structure mkdir -p /backups/.ssh/ touch /backups/.ssh/authorized_keys ...
Dave's user avatar
  • 542
1 vote
2 answers
58 views

SSH is not authenticating by SSH key

I cannot login to my server by SSH keys. I copied public key name.pub to my server using ssh-copy-id. If I then run ssh -i name.key root@server, I have to insert the server's password instead of being ...
DaPurr's user avatar
  • 21
1 vote
0 answers
169 views

PKCS#11 provider in OpenSSH: Is it possible to cache PIN?

I use a RSA key on a smartcard with an OpenSSH client. The smartcard is read by a smartcard reader with a pinpad. The key is protected with a PIN. Is it possible to cache the PIN somehow? I don't ...
d.c.'s user avatar
  • 887
2 votes
3 answers
2k views

Copy ssh keys to a new computer

I'm changing between computers. On an old one I have SSH keys (to remote servers, AWS, etc...) Is it considered to be a good practice just to copy the .ssh folder to a new computer ? If not, what is a ...
Michael D's user avatar
  • 123
-5 votes
0 answers
52 views

SSH: Permission Denied (publickey,password) [closed]

new to cybersecurity bear w/me. Just a learning situation is all, to progress onwards I took it far as I could it asked me to prepare & encode the PAYLOAD etc. I did those 4 steps. Why after ...
ScreamGPT's user avatar
-2 votes
1 answer
808 views

SSH: Permission Denied (publickey,password)

new to cybersecurity bear w/me. Just a learning situation is all, to progress onwards I took it far as I could it asked me to prepare & encode the PAYLOAD etc. I did those 4 steps. Why after ...
ScreamGPT's user avatar
0 votes
1 answer
58 views

When exchanging keys between source and target systems, does local account have to exist on a remote system as well?

Full rephrase: Local system server_local has an account username_local. I am logging under this account, generate a public key and send it to the remote system server_remote, where it is added to the ...
access_granted's user avatar
0 votes
0 answers
19 views

Mosquitto with encrypted key automatic start

mosquitto service does not support config parameter to put the password in for the encrypted private key. It asks for it on start of the service, which is not convenient for IoT device. I do not want ...
smoofy's user avatar
  • 1
0 votes
0 answers
77 views

How do I use curl to copy stdin to a remote host with key-based auth?

I'd like to paste the output of a command to a file in a remote host. $ <pipeline> | curl -T - -u root --pubkey ~/.ssh/id_rsa.pub --key ~/.ssh/id_rsa scp://<host>:<port>/<path> ...
ychaouche's user avatar
  • 945
0 votes
0 answers
49 views

Which SSH setting takes precedence with Git?

Since I am sharing a login on a Alma Linux server with some colleagues, I was trying to better understand the precedence different settings take. We mainly use the server to run time-consuming Python ...
winkmal's user avatar
  • 101
0 votes
0 answers
45 views

Allowing public key server access only for non-interactive shells

So we have setup a login service at our big company. In short if you come from within a recognized network you only need a public key to ssh in, otherwise you need to enter a 2FA code. Our pam.d/sshd ...
N3buchadnezzar's user avatar
1 vote
2 answers
668 views

Fail to ssh login with public key

I try to use a public key to connect to a remote server running centos7. I generated a key by ssh-keygen then copy the key to the server by ssh-copy-id [email protected] the authorized_keys ...
Rekkhan's user avatar
  • 11
0 votes
1 answer
1k views

Gitlab push/pull: Git asks for password of user git

I set up SSH Keys on my Windows Machine and then I added the key in my gitlab account according to the setup guide: Gitlab SSH KEY But I ran into an issue: When I try to test the connection with ssh -...
Kektuto's user avatar
0 votes
1 answer
52 views

How to "merge" sln files?

Im pretty new to c++ and want to add keyauth to my simple application. I want to use this (https://github.com/KeyAuth/KeyAuth-CPP-Example) as a base. How do I add the solution file to my existing ...
Nikolaus's user avatar
-4 votes
1 answer
155 views

ssh passwordless login to root account

When installing Kali-Linux distro version 6.0 the assisted installation process ask for a user name (I entered Joe, could be any other...) and it created the user Joe (with the same privileges as the ...
ZEE's user avatar
  • 229
2 votes
1 answer
726 views

Is there a way to check when an ssh key from authorized_keys was last used?

My authorized_keys on some of my debian flavoured servers have become bloated with keys from old PCs, etc. Is there a way I can tell which key has been used to log in? I would like to clean it up. I ...
JoSSte's user avatar
  • 163
0 votes
1 answer
2k views

Rocky Linux 9 not accepting SFTP connections from old Dreamweaver version (no matching host key type found. Their offer: ssh-rsa,ssh-dss)

Running Rocky Linux 9 on server and I am trying to connect by password, not by key... It works when connecting with Putty on port 22, but when I try to connect with an old Dreamweaver version, ...
adrianTNT's user avatar
  • 513
0 votes
1 answer
185 views

New SSH key pairs can not be resolved

I have removed the complete know_hosts and config as well as public keys and private keys under the folder ~/.ssh/. I also removed all public keys in github. Then I generated a new ed25519 key pair. ...
helloword's user avatar
1 vote
1 answer
529 views

Ansible - Push authorized key to multiple host groups with different passwords

I want to push a new user's public key to a host invetory using Ansible. For that, a playbook was created like the following example. --- - name: vms1 - Authorize hosts with pub key hosts: vms1 ...
markfree's user avatar
  • 185
0 votes
1 answer
111 views

Can't connect to any EC2 Linux instance

I'm facing a very simple issue here; I'm not able to connect to my Linux (bitnami-redmine-5.0.3-4-r06-linux-debian-11-x86_64) Virtual Machine. I've created another sister VM to check, and can't ...
mr. anderson's user avatar
0 votes
1 answer
142 views

Why do I still get prompted for ssh passphrase?

When I ssh into my Ubuntu 20.04.1 system from my Mac 12.6 system, I am being prompted for my key passphrase each time, but don't know how to get rid of the prompt. Below is the output from the Ubuntu ...
Michael57's user avatar
0 votes
1 answer
317 views

Command to delete a public key from the ~/.ssh/authorized_keys file?

About SSH - if in the client is executed the command: ssh-keygen -R <hostname|ip> The public key(s) of the server is/are removed from the ~/.ssh/known_hosts file Now, in the server: Question: ...
Manuel Jordan's user avatar
1 vote
1 answer
334 views

Safely restricting key-based authentication for only sftp access

I can restrict a key installed into ~/.ssh/authorized_keys to only allow file transfers by forcing an in-process SFTP server: command="internal-sftp" ssh-rsa AAAAB3NzaC1...(the key follows) ...
Nikita Kipriyanov's user avatar
0 votes
1 answer
756 views

Which public key format should be used for libssh2 public key authentication?

I am trying pass publickey (id_rsa.pub) for sftp_write example in libssh2 library. const char *pubkey = "/home/username/.ssh/id_rsa.pub"; const char *privkey = NULL; if(...
VamsiKrishna Neelam's user avatar
0 votes
1 answer
30 views

How to specify the ssh key on the remote host?

I am not an admin and therefore I do not have access rights to the remote server. I accidentally moved all the files and folders of the remote host to a new folder, so the file ~/.ssh/authorized_keys ...
MagicLudo's user avatar
0 votes
2 answers
420 views

Prevent users abusing private ssh keys

It's my experience that users will sprinkle an infrastructure with both public and private keys. While openssh allows for restricting public keys to a specific directory (which discourages them from ...
symcbean's user avatar
  • 5,110
1 vote
3 answers
16k views

ssh publickey authentication failure: receive packet: type 51. sshd is not accepting publickey auth at all

I have read numerous solutions to this problem, but none seem to apply to what I'm seeing. Most focus on directory permissions, but those appear to be correct in this case. TL;DR: Two Centos7 servers ...
srh's user avatar
  • 43
0 votes
2 answers
350 views

Login SSH using RSA key instead of normal login

I use ssh-keygen to generate a pair of keys on Kali ~/.ssh folder. Great. I also added the public key to ~/.ssh/authorized_keys. Permissions have been set to 600 for that file too. Results are: Putty:...
Jonathan Bock's user avatar
0 votes
0 answers
956 views

no matching key exchange method found when using SFTP

My remote server(A) is having RHEL 8 OS and another server(B) runs with RHEL 5. I need to SFTP to server A to B. I have used below method. sftp [email protected] But I am getting below error. Unable ...
edublog's user avatar
  • 73
3 votes
0 answers
359 views

Unlock an ssh private key with a biometric token instead of a passphrase

I have private ssh keys that are protected by a passphrase. Is it possible to unlock those keys with some biometric token, in particular my personal fingerprint, instead of the passphrase? I am using ...
Zuabi's user avatar
  • 131
2 votes
1 answer
2k views

"Authentication refused: bad ownership or modes for directory /home/user" - how to force sshd accept auth despite "wrong" permissions?

For some reasons, I NEED the home directory of some particular user to be group-writable. However, when trying to login to that user with ssh key, sshd refuses the authentication, as it requires the ...
raj's user avatar
  • 1,014
0 votes
2 answers
926 views

receiving GPG error while using sudo apt update in Pop!_OS 22.04

I ran this command in Terminal: sudo apt update At the end I received this message: W: An error occurred during the signature verification. The repository is not updated and the previous index files ...
ChidanshM's user avatar
1 vote
0 answers
342 views

disable ssh public key auth when user is expired

Environment is Ubuntu Bionic LTS, I have local user account which is expired, i.e. # chage -l user-test Last password change : Apr 28, 2021 Password expires : ...
Ante Gabrielssen's user avatar
1 vote
3 answers
229 views

Where is the undo button in Linux? If I created an SSH key and copied the public key to a NAS, how would I undo or delete it?

I created an SSH key using ssh-keygen -t rsa. Then I copied the key to the NAS, so I wouldn't have to enter a password using ssh-copy-id. I realized that I did it for the wrong user, so now I need to ...
anon's user avatar
  • 11
1 vote
1 answer
3k views

Read key properties

I have multiple keys (some private, some public) and I want to get information about them (their length, their type, anything else). Is that possible?
aac's user avatar
  • 35
2 votes
1 answer
7k views

For OpenSSH legacy hardware access, ssh-rsa is used as preferred host key algorithm only if -oHostkeyAlgorithms=+ssh-rsa is included on command line

The connection is for WD MyCloud [OS3], local network only as cloud access has been closed. Sshd_config contains: HostKeyAlgorithms=ssh-rsa,ssh-rsa-cert[email protected] PubkeyAcceptedAlgorithms=+ssh-...
Kcrist's user avatar
  • 21
0 votes
1 answer
315 views

Access to Linux server still requires password after setup authorized_keys

I have both manually set up the authorized_keys and using ssh-copy-id, but it still requires the password. I have made sure my home directory has 755, the .ssh has 700 and authorized_keys has 600 Here ...
Zepeng Huo's user avatar
0 votes
1 answer
2k views

Using SSH Git: key lost after system restart?

I am setting up Git usage on Raspbian. This worked OK: cd .ssh ssh-keygen -t rsa -b 4096 -C "[email protected]" eval $(ssh-agent -s) ssh-add ./id_rsa_rpi After I created the keys ...
Danijel's user avatar
  • 168

1
2 3 4 5
8