date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,638,661,752,000 |
We can change the default port settings at /etc/ssh/sshd_config but the manual does not provide any information if we can assign different ports for different users? Is setting up multiple ports for a service possible?
|
Yes.
Example of a server which listens on ports 666 and 667, and only allows users whose names start with "a" through port 666:
Port 666
Port 667
Match LocalPort 666
AllowUsers a*
Go read about all those directives in the sshd_config(5) manpage.
| Is it possible to configure different ssh ports for different users? |
1,638,661,752,000 |
I have a Stretch-based desktop with IPv6 disabled, both as parameter in the kernel.
I have the ssh client from the openssh-client package, version 1:7.6p1-2.0nosystemd1, installed.
Upon debugging a DNS resolving problem, I did notice nonetheless the ssh client is doing IPv6 DNS related queries as the included tcpdump... |
To disable IPv6 name queries in your sshclient, you can:
call ssh in the command line with the -4 option to only operate and do queries in IPv4;
define then an alias as:
alias ssh=`ssh -4`
If you have system administration of the machine, you can also disable the IPv6 functions/DNS queries in the ssh client system ... | Disabling openssh client AAAA DNS queries |
1,638,661,752,000 |
I had openssh-server working on my dedicated server running proxmox, but everytime I tried to upgrade anything I got this error:
dpkg:error processing package openssh-server (--configure):
subprocess installed post-installation script returned error exit status 10
So I read on forums that I should uninstall and purge... |
At last I couldn't config openssh-server but I edit my /etc/apt/sources.list and added these lines:
(As my server is in Hetzner Co.)
deb http://mirror.hetzner.de/debian/packages jessie main contrib non-free
deb http://mirror.hetzner.de/debian/security jessie/updates main contrib non-free
deb http://mirror.hetzner.de/d... | subprocess installed post-installation script returned error exit status 10 |
1,638,661,752,000 |
I have been maintaining an old Linux server (CentOS 6.5) for long term.
I access that Linux server by ssh with 'pub key auth'.
Now I just bought a new Windows (win10 or 11 not sure) laptop and installed ‘Git for win 2.33’, when I try to ssh from the new lap top as usual, I got:
$ ssh -i ~/.ssh/id_rsa.bridge_to_home -... |
Just ran into this at work on a new Windows machine with a new Cygwin installed that installed OpenSSH 9. Turns out that in 8.something, the OpenSSH team disabled the older ssh-rsa encryption algorithms by default. (See https://www.openssh.com/releasenotes.html)
It's not the server rejecting you; it's that your newer ... | Old Linux rejects my ssh id_rsa key from newly installed windows |
1,638,661,752,000 |
This question stems out of curiosity, but lets say I currently have an ssh session with a remote computer, and I run the following command:
sudo systemctl stop ssh
and after running:
systemctl status ssh
to verify the status of the service, it seems to be inactive(dead)
why am I still able to execute any commands remo... |
When you connect, the SSH daemon (e.g. sshd) forks at least once. From now on your connection is handled by a separate process, not the listening daemon itself.
systemctl stop ssh stops the listening daemon, so new SSH connections cannot be established. Existing connections survive because forked processes survive.
Th... | Why does running sudo systemctl stop ssh over ssh not immediately terminate the ssh session |
1,638,661,752,000 |
on my host server I have my user with generated private and public keys.
I have copied public key value to my remote server authorized_keys file.
I have mapped new docker container instance to use the .ssh folder as a volume and set network to the host's network.
-v /home/jenkins/.ssh:/home/jenkins/.ssh --network host... |
From your debug output, you could see that since you're running the ssh command as root, it searches for the ssh keys in root's home folder instead of jenkins home folder.
debug1: Trying private key: /root/.ssh/id_rsa
debug3: no such identity: /root/.ssh/id_rsa: No such file or directory
You should provide the locati... | can't SSH from docker container to remote server |
1,638,661,752,000 |
Description
I have created an ssh connection between my MS-Windows PC and Raspberry Pi. To do so I followed the following steps:
Step 1: Somehow get the IP address of the Raspberry Pi. It should be something like this: 192.168.1.52
Step 2: Open a shell and access the Raspberry Pi via ssh:
ssh [email protected]
You wi... |
From your log:
debug1: Next authentication method: publickey
debug1: Offering public key: federico@federico RSA SHA256:E96Hu2Ee+IyAuoZ06GxTvo+ZmAkzqfihbAKkFqxU1AU agent
debug1: Server accepts key: federico@federico RSA SHA256:E96Hu2Ee+IyAuoZ06GxTvo+ZmAkzqfihbAKkFqxU1AU agent
debug1: Authentication succeeded (publickey... | Why am I able to SSH a remote machine even with the wrong keys? |
1,638,661,752,000 |
I am using Openwrt here, I find that I can login remote host without a password or private key. I added a SSH-Keys (public key) in System->Administration tab, this public key is a key pair with the remote host's private key.
I thought that ssh client must using private key to login, situation here seems it used a publ... |
debug3: sign_and_send_pubkey: RSA SHA256:wfA3yC7+sEIeTSQp6NUmP14XlgEX5WuJyVoL9m3WrX4
debug1: Authentication succeeded (publickey).
Authenticated to <HOST> ([<HOST>]:443).
says that you are using public key authentication, that succeeded. The key does not have a path, most probably because it is offered by the ssh-age... | Why can I login remote host without password or private key? |
1,638,661,752,000 |
I've configured several systems manually. I'd like to start working more systematically now.
I configure openssh-server more strictly than Debian defaults, to exclude password-guessing attacks.
So I worked on some sequences for system configuration. I notice SSH is a problem. When you install openssh-server on Deb... |
Sequence
Create an empty file /etc/ssh/sshd_not_to_be_run, if openssh-server is not installed. (Some options for scripting this condition here)
Install openssh-server
Edit /etc/ssh/sshd_config as desired
Remove /etc/ssh/sshd_not_to_be_run
Run
systemctl enable ssh
systemctl systemctl restart ssh
or a well-tested equ... | Configuring my sshd securely (with automation) [duplicate] |
1,638,661,752,000 |
With this loop we sequential update on all servers (server list = consul members | grep awk {'print $2'} | cut -d ":" -f1) the package consul.
for i in $(consul members | grep awk {'print $2'} | cut -d ":" -f1) ; do sshpass -p $PASSWORD ssh -oStrictHostKeyChecking=no -q root@$i "hostname && yum clean all && yum -y upd... |
Indeed, pssh sounds like the better solution. If you must use parallel it should be fairly simple: pipe the hostnames one per line into a single command that uses {} as a placehold. Eg:
consul members | ... awk {'print $2'} | cut -d ":" -f1 |
parallel -j 10 sshpass -p "$PASSWORD" ssh -oStrictHostKeyChecking=no -q root... | GNU Parallel and sshpass with server list in a loop |
1,638,661,752,000 |
I face the following situation on one machine with 64bit Mint 17.3 Cinnamon:
$ sudo apt-get install openssh-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
openssh-client:i386 openssh-sftp-server
Suggested packages... |
Per your apt-cache policy output, you have openssh-client 1:6.6p1-2ubuntu2.6 installed, but this doesn't correspond to any URL, and the version number is not the same as the server version number.
The Debian ssh packages require the client and server versions to match exactly.
So, it's clear why apt wants to remove th... | Why installing openssh-server would remove openssh-client? |
1,638,661,752,000 |
I am logged into my Debian machine. I want my friend to get in via SSH. He comes to authenticate as the user friend. My machine asks him for a password. He does not know the password. I want to be able to let him in by running a command my session (root) that is already authenticated. I do not want to tell him t... |
You could potentially do this using screen (which you may need to install) and SSH keys.
You need to log in as root and then run 'screen -US friend' (install if necessary), run whatever commands you need to do, and the detach from that (using 'Ctrl-A D') to leave it running.
Then in /root/.authorized_keys add your fri... | Open the SSH Door to a Knocking Friend |
1,638,661,752,000 |
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:
Is there a command to delete the public key of the client stored in the ~/.ssh/authorized_keys file?.
It to be used mostly f... |
You could use sed :
sed -i '/ *username@client-hostname *$/d' ~/.ssh/authorized_keys
man ssh talk about editing the file, it seems there's no specific tool to achieve this simple task
| Command to delete a public key from the ~/.ssh/authorized_keys file? |
1,596,664,921,000 |
I am trying to forward a gpg-agent Unix socket to a remote machine. I have tried the following two versions of the remote forwarding command:
A: ssh -vvv -N -R ~/.gnupg/S.gpg-agent:~/.gnupg/S.gpg-agent.extra {HOST}
B: ssh -vvv -N -R ~/.gnupg/S.gpg-agent:/home/{USER}/.gnupg/S.gpg-agent.extra {HOST}
They both report s... |
The ~ must be expanded by some program. Usually this program is the shell. The sshd daemon doesn't feed the path to a shell and doesn't expand the path.
But you don't need an expansion for the current users home directory as it is the working directory anyway.
Try
ssh -vvv -N -R ~/.gnupg/S.gpg-agent:${HOME}/.gnupg/S.g... | Does OpenSSH >=7.2 support local-side tilde expansion for remote Unix socket forwarding |
1,596,664,921,000 |
I am trying to setup a vpn via openssh.
I am running the client on Arch Linux. The version of the client is OpenSSH_7.7p1, OpenSSL 1.1.0h 27 Mar 2018.
The ssh server is on Ubuntu 17.10 on Google Cloud, version OpenSSH_7.5p1 Ubuntu-10ubuntu0.1, OpenSSL 1.0.2g 1 Mar 2016. In the server configuration I have enabled a... |
I have the same problem on my Arch Linux. ArchLinux is installed on the client and server. The version of openssh is 7.7p1-1.
As a temporary solution, I installed openssh version 7.6p1-2
| Cannot create OpenSSH tunnel |
1,596,664,921,000 |
Are there any configs for OpenSSH server to disallow weak (e.g. <2048 bits) RSA keys? I'm aware of PubkeyAccetedAlgorithms which can disallow specific key types, incl. rsa-sha2, as a whole.
|
The RequiredRSASize option was added in OpenSSH 9.1, released on October 4th, 2022:
ssh(1), sshd(8): add a RequiredRSASize directive to set a minimum
RSA key length. Keys below this length will be ignored for user
authentication and for host authentication in sshd(8).
ssh(1) will terminate a connection if the server... | OpenSSH: how to disallow weak (<2048 bits) RSA keys |
1,596,664,921,000 |
I have been trying to establish a connection to a remote server controlled by a hosting company. I provided them with my .pub file and they say that it has been added to the authorized_keys file on the server. My connection always seems to default back to password authentication. I am in contact with the hosting compa... |
You see several times in the debug log that your ssh client did load your id_rsa key:
debug1: identity file /home/karst/.ssh/id_rsa type 1
...
debug2: key: /home/karst/.ssh/id_rsa (0x5583355be270)
and offers it to the server ...
debug1: Offering RSA public key: /home/karst/.ssh/id_rsa
... and there's hope ...
debug... | ssh not able to read ~/.ssh/id_rsa |
1,596,664,921,000 |
I am trying to connect to a server I have previously connected to. However newer version of OpenSSH does not use DSA keys. I get the following error when trying to connect:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@... |
I think the message is misleading, the RSA host key did not change.
The message is valid. The key in your known_hosts is DSA and the server sends RSA, they differ and it is wrong.
Since OpenSSH 6.8 the server sends all the keys after authentication to simplify the hostkey rotation or deprecation.
If you have new eno... | Why does SSH reports possible man-in-the-middle with different key types? |
1,596,664,921,000 |
it is necessary to update the openssh server to the latest version, since everything is closed, it has come to manually assemble it
./configure --prefix=/usr --with-pam --with-selinux --with-privsep-path=/var/lib/sshd/ --with-kerberos5=/etc/krb5.conf --sysconfdir=/etc/ssh --with-default-path=/usr/bin --with-pid-dir=/r... |
"GSSAPIKexAlgorithms" isn't a standard Openssh server feature. It's apparently part of a feature added to Openssh by some Linux vendors. For example, here is the patch page for Debian's version of Openssh 9.2. "gssapi.patch" on that page adds support for GSSAPIKexAlgorithms and some other configuration options. I'm no... | How to restart sshd after assembly? |
1,596,664,921,000 |
This is a kind of follow-up question to this question: ssh, start a specific shell, and run a command on the remote machine?, except more-specifically regarding ash, and focused on the fact that sourcing a .bashrc file as part of starting the shell in the ssh session doesn't work for me.
I'm on an embedded Linux devic... |
Why are you running ash? A system with busybox is unlikely to have two different shells. (It's technically possible that /bin/sh is not the same shell as /bin/ash, but it would be a very unlikely setup on an embedded device.)
Apart from a few simple aliases or functions, very little of the typical content of .bashrc i... | ssh, start a specific shell (ash), and source your environment on the remote machine |
1,596,664,921,000 |
I have a set of RPi4s (7 of them) running Ubuntu 20.04.
One of them is the gui, from where I run commands.
There are 3 managers and 3 workers (/etc/hosts is properly set up on all of them).
Initially, they all have a user with the same name and password in all of them.
I want to set up SSH in a single script run once ... |
I can't see why you've got the long sleep statements spread around, and I'm not convinced I've traced your program's flow correctly. However, looking at the requirements, you need
The gui* machines should have access to all; manager* machines should have access to managers and workers; and workers should only be able... | ssh-copy-id working erratically in a loop in a script (cluster) |
1,596,664,921,000 |
Suppose I am using Match Group and inside of that block I am using ForceCommand is there a way to refer to the name of the connecting user or the user's home folder in a similar fashion AuthorizedKeysFile can use the tokens %h, %U, and %u?
Alternatively does ForceCommand get the contents of these tokens in some other ... |
The command is run as the use you are connecting to. Thus, you have $USER, $LOGNAME, $HOME, etc. set to that same user. There's no problem in using them.
The command itself is run with the user shell (usually bash, so /bin/bash -c 'your_forcecommand'), so you can include such variables in the ForceCommand and they wil... | After Match Group block, in ForceCommand can I somehow refer to the username (etc.) in a generic fashion? |
1,596,664,921,000 |
First, I want to be clear, I am not asking about just using public key authentication without a prompt. I have a use case where a user must only be allowed access through SSH public key authentication. Logging in via password on a serial terminal is something I want disabled for this user. I am building my own linux k... |
It is possible to configure either behavior.
If the password field in /etc/shadow begins with an exclamation point, then the account is locked. The account cannot be logged into with SSH and generally any attempt to access the account except by root will fail.
If the password contains another invalid password (conven... | Can a user with no password set login with ssh? |
1,596,664,921,000 |
I have a gateway to ssh into from the bad world wide web. No problem, I get:
remote ~$ ssh -X ingo@gateway
Debian GNU/Linux 10 (buster)
0:ingo@gateway ~$
Now I manage my other hosts, for example the fileserver:
0:ingo@gateway ~$ ssh -X ingo@fileserver
Warning: untrusted X11 forwarding setup failed: xauth key data not... |
When your only connection to an X11 server is untrusted, you cannot forward it further.
The untrusted X11 forwarding works by the ssh client connecting to the local display, and using the xauth generate $DISPLAY . untrusted command to generate an untrusted key / cookie.
But for that, the xauth command needs the SECURI... | "Warning: untrusted X11 forwarding setup failed" on nested ssh |
1,596,664,921,000 |
I know there are a million similar posts, but I have not yet found one that answers this question.
I'm trying to establish an ssh connection from an Ubuntu 18.04 client to the built-in OpenSSH SSH Server on the Windows-10 v1903 build. I do NOT have an Internet domain, so the Windows host will be visible on the Intern... |
The publickey auth is failing because the authorized_keys file is empty.
It is empty because you didn't add the public key to it. You could add it by first cd-ing to test_users .ssh directory on the windows box and running something like:
cat id_ecdsa.pub >> authorized_keys
(or whatever the public key's filename i... | How to Require PubkeyAuthentication using SSH from Linux client to Windows OpenSSH server |
1,596,664,921,000 |
In ssh server and client authentication, key fingerprints are presented in different ways, even using the same command ssh-keygen -lf (in different hosts or as regards different keys).
Representation 1:
$ ssh-keygen -lf /etc/ssh/ssh_host_ed25519_key.pub
256 SHA256:3RE3UrGaTAec8H4YnZG7JTlfXpKvl89iexdqzLCyffY root@hostn... |
Older versions of the ssh-keygen utility from OpenSSH displayed only MD5 hashes; the utility now defaults to displaying a SHA256 hash, although you can still select an MD5 hash using the -E option:
user@host:~/.ssh$ ssh-keygen -E md5 -l -f samplekey
2048 MD5:e6:1f:73:0f:14:cb:9a:71:2f:3b:31:b7:3f:58:1c:52 user@host (R... | Several representations for key fingerprint |
1,596,664,921,000 |
I must update OpenSSH on my RHEL 5.5 because of CVE-2018-15473. My OpenSSH version is OpenSSH_4.3p2 and must be update to OpenSSH_7.9, when i want to do this i get that message when using configure command
checking OpenSSL library version... configure: error: OpenSSL >= 1.0.1 required (have "0090802f (OpenSSL 0.9.8e-f... |
I solved my problem with the below string of commands:
Download the latest version of the OpenSSL source package:
wget ftp://ftp.openssl.org/source/openssl-1.0.1g.tar.gz
Install OpenSSL 2 & openssh-7.9p1:
tar xzvf openssl-1.0.1g.tar.gz
tar -zxvf openssh-7.9p1.tar.gz
cd openssl-1.0.2p
./config shared zlib
make instal... | Update OpenSSH on RHEL 5.5 |
1,596,664,921,000 |
Suppose these two operating systems and SSH software:
GNU/Linux Debian 9.3 with OpenSSH version 1:7.4p1-10+deb9u2
Linux Mint 18.3 with OpenSSH version 1:7.2p2-4ubuntu2.4
And I want to switch away from rsa completely to the benefits of curve ed25519.
The question is, after I generate ed25519 on both systems with:
ss... |
No, deleting the key pair is fine. All you have to do is to delete your public key from the server. However, you don't remove it with rm; you delete the relevant lines from the ~/.ssh/authorized_keys file.
Check first that you can log in with your new key pair!
For cleanliness, I'd also suggest you to remove your priv... | What is the correct way to remove RSA key-pair entirely from my SSH configuration? |
1,596,664,921,000 |
So I've been trying for the past two hours to SSH into my own computer via localhost. But it says "Permission Denied (public key)".
I am running Ubuntu 14 LTS on VirtualBox. Here're my current settings:
My /home/username directory has the ".ssh" folder with the files "known_hosts", "initialkey" and "initialkey.pub". ... |
SSH is very paranoid about keys. If any directory on the path is writable by anyone other than the owner it will not trust the key. Check the permissions on all the directories in the path. Permissions should be something like drwxr-xr-x or drwxr-x---. Permissions like drwxrwxr-x or drwxrwxrwx will cause the key t... | Can't SSH into localhost |
1,596,664,921,000 |
I'm trying to SSH from Debian (Jessie, installed as chroot environment in Chrome OS) to Arch on the same network, and I keep getting an error saying the connection was refused because of a public key error.
|
Option 1
Enable password authentication on Server (your computer running arch-linux)
Edit the SSH configuration file on the server to allow password authentication.
[user@arch]$ sudo nano /etc/ssh/sshd_config
PasswordAuthentication yes
ChallengeResponseAuthentication yes
Use your favorite text editor instead of nan... | SSH public key error |
1,596,664,921,000 |
I have the following setup:
Computer A has a Wifi-USB adapter (and is a robot, so it doesn't need real internet access). It's running Ubuntu 14.04.
Computer B is my Laptop running Ubuntu 14.04 also.
What I have done is setup a local Wifi hotspot on Computer B using this guide. It has an ethernet cable connected to it,... |
Ok, apparently I do need openssh-server on Computer A, even though I am in the same network. I read that wrong somewhere else then.
| SSH in local network while hosting same network |
1,596,664,921,000 |
When ssh'ing to my server (RaspPi running Arch), it doesn't accept my password (which I'm 98% sure is correct), and the usual delay before Permission denied, please try again. is not there. Elsewise, the server is running fine.
I tried using the default /etc/ssh/ssh_config and /etc/ssh/sshd_config to no avail. Login w... |
Thanks to @ams, I got access to the logs, where it seemeed to be a problem with PAM. I disabled pam-authentication in sshd_config, and was able to log in as root. There I could do a system update (in which pam had a new version), and logging in as my normal user is now possible.
However, for some reason the pause betw... | SSH login not accepted, and no delay between ssh login attempts |
1,596,664,921,000 |
I have a reverse SSH server in Cisco router(runs IOS operating system) and it listens on port 2001:
C1841#sh control-plane host open-ports
Active internet connections (servers and established)
Prot Local Address Foreign Address Service State
tcp *:... |
This is simply a feature of the Cisso ssh server implementation; it parses the user name, and if it contains a :[0-9]+ component then it understands it has to connect the session to the console port with the corresponding number.
Note it has nothing to do with an alternate port number, those connects happen over port ... | Integer after username in OpenSSH client separated by colon |
1,596,664,921,000 |
I have downloaded and compiled the latest version of libssl, the result of which is located at /usr/local/ssl. I want to compile libssh2 using the files in this folder, and to do that I've set the switch --with-libssl-prefix=/usr/local/ssl.
After performing ./configure --with-libssl-prefix=/usr/local/ssl and make, the... |
If you compiled and installed libssl into the default /usr/local path, there is a /usr/local/ssl, but the lib is not in there; it's just directories like certs and misc -- stuff that other things would probably put in a share directory (e.g. /usr/local/share/ssl).
The actual library is installed in a normal place, /us... | Compiling LibSSH2 with specific LibSSL |
1,596,664,921,000 |
All of a sudden, I couldn't ssh to a machine to which I used to ssh earlier.
Consider I am ssh-ing from A to B.
Output when I run
ssh root@ip_addr_of_B
I get:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
Output when I run ssh -vv root@ip_addr_of_B from A
OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
... |
Obviously you disabled password authentication, you don't have ssh keys and kerberos is not configured. Either login locally or login via serial console, or via KVM or if you have server-class machine then it should have a management interface (BMC) allowing remote access to local serial port or making graphical conso... | Can't ssh to a machine |
1,596,664,921,000 |
I am trying to use ssh to connect to a server on 3 different thinkpads: T430s, E420, and a T400. SSH just hangs at connecting to sdf.org [205.166.94.16] port 2 (sdf is a known working ssh server). I can telnet, ping, curl, and even telnet over port 22 sdf.org with no issues. I can also connect using my desktop which i... |
According to this, some routers dislike the IP_TOS value set by ssh. You may check if that is the case by running:
ssh -o "IPQoS 0x00" -vvv [email protected]
If that works, you can avoid typing it all the time by adding that option (without the quotes, just IPQoS 0x00) to the relevant portion of your ssh config file ... | Unable to connect to anything using ssh |
1,596,664,921,000 |
About the ssh-keyscan command for the -H option according with:
ssh-keyscan — gather ssh public keys
it indicates
-H Hash all hostnames and addresses in the output. Hashed names may be used normally
by ssh and sshd, but they do not reveal identifying information should the file's
contents be... |
The one-way hashing is advertised as a means to make it more difficult for an attacker to know what hosts you SSH to should said attacker get their hands on your known_hosts file. Here is what ssh_config(5) says:
HashKnownHosts
Indicates that ssh(1) should hash host names and addresses when
they are... | How does -H work in the ssh-keyscan command? |
1,596,664,921,000 |
In sshd(8) man page:
The OpenSSH SSH daemon supports SSH protocol 2 only. Each host has a host-specific key, used to identify the host. Whenever a client connects, the daemon responds with its public host key. The client compares the host key against its own database to verify that it has not changed. Forward secrecy... |
Can someone explain in detail what does The client compares the host key against its own database to verify that it has not changed means?
When you ssh into a (previously unknown) machine, you will get this query (for e.g. ECDSA-type key):
ssh user@newhost:
The authenticity of host 'newhost (<IP-address>)' can't be... | How does the sshd authentication process work? |
1,596,664,921,000 |
In OpenSSH, verbose mode (ssh -v ...) shows some useful statistics on exit (e.g. Transferred: sent 3532, received 3076 bytes, in 5.5 seconds). However, verbose mode also prints lots of debug1: ... lines that I do not care about. For example:
$ ssh -v -N -D localhost:12345 [email protected]
OpenSSH_8.2p1 Ubuntu-4ubuntu... |
The "transferred..." messages are printed at the "verbose" log level. You can set ssh to the "verbose" level using the "-o LogLevel" option:
% ssh -o LogLevel=verbose localhost echo hello
Authenticated to localhost ([::1]:22).
hello
Transferred: sent 2768, received 2880 bytes, in 0.0 seconds
Bytes per second: sent 117... | SSH verbose mode: how to view amount of data transferred without all the "debug1" lines? |
1,596,664,921,000 |
How to convert RFC4716 private keys to PEM private keys in ubuntu 20.04?
For our project we generated ssh keys on a device running the latest openssh software. JSch complained about authentication:
Exception com.jcraft.jsch.JSchException: Auth fail
After a lot of research, including building a minimal git client we d... |
$ cat /tmp/test
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
NhAAAAAwEAAQAAAYEArKk9jKvP/kwZq5GAog449OK5LzjppL5DbQhlJcqntzqu88+6WDHr
lQM0IKyHgEkRDim8MrmisK2eIJrmj99STJEBPu7jgJ0q2ASToSeFiU8FB+yrV9ZmelwJ7f
1rD5vp3TlROAc08pIKb2YVHE4KfLzAncGXVETldTuGDAHgXQWIlhZD... | How to convert RFC4716 private keys to PEM private keys? |
1,561,648,719,000 |
My question regards ssh, sftp, scp, rsync, etc. commands where you connect to another machine which can be in your Local Area Network (LAN) or at some remote location you would typically connect via the Wide Area Network (WAN) or greater internet.
For instance, if you were to use these each of these two commands,
ssh ... |
First your router is not just a router, it is also a ethernet switch, a DHCP server, A wifi hotspot, a modem, …
2nd it should be routed the best way: if on same sub-net 192.168.0.x then it will be routed by the machines, and not go through the router (not the router part of the router, just the ethernet switch).
What ... | If you ssh to another device in your LAN, can you accidentally connect through a less direct pathway (WAN)? |
1,561,648,719,000 |
In ssh configuration directory, the file known_hosts stores for each server the (IP, fingerprint) couple. A server is trusted only if it matches both the elements of one of the couples in known_hosts.
I need to connect to a Nitrux 1.1.4 Linux server (based on kernel 4.14.15-041415-generic) which for several reasons is... |
A server is trusted when it matches the pattern before the fingerprint hash. ssh just adds both hostname and IP by default which requires to match both of them. Nothing holds you from editing known_hosts manually and replace IP with a mask (recommended) or remove IP at all (less secure way).
So the entry in known_host... | ssh, trust hosts on fingerprint basis only, regardless of IP |
1,561,648,719,000 |
I have docker running on a synology nas.
The nas has a private network (172.17.0.0/16) where docker places the containers.
It also has a public facing interface on my lan, call it 10.11.12.10/24.
internet
^
|
|
+----+... |
Adding the route to the pfsense makes the traffic flow weird.
Traffic from the laptop bounces over the pfsense, back down to the nas and then to the container. Replies from the container however will go via the nas directly to the laptop on layer 2. No routing needed.
A consequence of that is that the firewall on the ... | ssh to docker container breaks after 45 seconds |
1,561,648,719,000 |
I seem to be not able to generate a RSA-4096 SSH key in OpenSSH's new key format with the following command:
$ ssh-keygen \
-f rsa4096_key \
-t rsa \
-b 4096 \
-C 'This is a test' \
-o \
-N ''
At least I get the following error message after trying to change the existing comment of the RSA-4096 SSH key:
$... |
I think this is a bug in both the -o switches behavior as well as a documentation bug in OpenSSH.
This works for me:
$ ssh-keygen \
-f rsa4096_key \
-t rsa \
-b 4096 \
-C 'This is a test' \
-o \
-N ''
$ grep -o "This.*" rsa4096_key.pub
This is a test
So the comment is getting stored in the rsa4096_key.pu... | How to store RSA-4096 SSH key in OpenSSH's new key format |
1,561,648,719,000 |
How to create a (username/password or certificate) white/black list for ssh?
For example of blacklist, I can use any username/password combination to access the server, except the ones on the blacklist.
The ssh version can be OpenSSH.
And the server is a Linux.
Creating lots of users on Linux for white list is not a n... |
For a blacklist, in your sshd_config add the DenyUsers entry followed by a list of users separated by a space. You can also use DenyGroups in a similar fashion.
For example:
DenyUsers jimmy bill joe susan
or
DenyGroups teachers
A whitelist is created by using the AllowUsers and/or AllowGroups entries in the sshd_conf... | White List and Black List for SSH |
1,561,648,719,000 |
When I attempt to log in to a CentOS box via ssh, it hangs after putting in the password. I can get in to the system via console and when i run w I can see "cvs server" running for the user trying to login.
USER TTY FROM LOGIN IDLE PCPU WHAT
root pts/1 systemname 11:37 1:14m 0.00s cvs server
... |
I have found the troublemaker. There was an old entry in sshd_config that contained ForceCommand cvs server. Once I adjusted the comment mark and restart the service, I was able to log in just fine.
I actually went through this file at first but didn't check everything bit by bit. Could have saved me an hour or 2 to ... | SSH hangs on login, shows "cvs server" as the hung process for the user |
1,561,648,719,000 |
I know that it was not a good idea to do update OpenSSH to v. 7.6 on Centos 6.9, but it was done. So now I can't connect to the server by ssh.
Trying to login with key:
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 60
debug1: Se... |
So first of all, OpenSSH update is overwrite sshd_config file make not possible to login into the system by root (so if you do update for OpenSSH from a source - don't forget to check sshd_config before logout). But I was able to use Parallels VM Console to connect and change sshd_config but still get the same issue w... | Can't connect to Centos 6.9 after update to OpenSSH 7.6 on this server [duplicate] |
1,561,648,719,000 |
I have an old Linux box (version 2.6.12, compiled by a colleague) behind an NAT-enabled router, that I want to access from a remote PC. There's an SSH daemon running on the box, but since there was no SSH client yet, we compiled an old Dropbear client, which works fine when creating a tunnel.
I should note that the SS... |
This will definitely not be the solution for most, but I'll post it here anyway, maybe it can help someone else in the future.
The problem was that on the Linux box, the loopback interface was down by default. I'm still not sure why. I figured it out by trying to SSH to localhost, which failed. Pinging didn't work eit... | SSH to older Linux box using remote port forwarding |
1,561,648,719,000 |
I'm trying to connect to myself through ssh. (For testing purpose). I'm on a Ubuntu laptop. I successfully launched a ssh serveur, and "ssh localhost" works fine. If I try "ssh ", it works too. (I got it from ifconfig)
But if I try with my public IP adress (got it on whatismyipadress.com), it doesn't work, I get a tim... |
As @Findus23 says, you have to forward a port (different from the 22, which is perhaps used as default port to connect to SSH router itself) from the router to your PC.
I make an example:
PC [192.168.1.10] <==> [192.168.1.1] Router [1.1.1.1] <==> Internet
As you can see, connecting through SSH to the address 1.... | Can't ssh to myself through internet? |
1,561,648,719,000 |
This question is actually too broad...
What I really want to know is whether or not it actually chroots and, if so, how a SSH user deamon[1] can be launched in that jail in spite of the obvious lack of the required binary/lib in the chroot.
Google is surprisingly silent on the matter. But a good reference to explain... |
The other answer is quite vague (also the question is) so I will try to be more verbose about this phenomen. I know that this topic is not for everybody, but for these interested it is quite nice thing to know about.
There are two different places where the chroot is done and you are poking into both of them so I will... | How is OpenSSH sftp jail/chroot working? |
1,561,648,719,000 |
I'm trying to configure the following restrictions in my sshd_config:
Users with local IP addresses face no restrictions
Users with non-local IP addresses, who are in the sftp group, are allowed to use sftp in a chroot jail
Users with non-local IP addresses, who are not in the sftp group, are not allowed to do anythi... |
Your netmaks are incorrect. If you want to include private networks, you should use :
10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
This is probably why you do not match, rather than a ssh bug.
| Unexpected Match behavior in sshd_config |
1,561,648,719,000 |
New installation of RHEL8 with openssh-server installed, enabled, and running.
firewall-cmd shows service ssh is added:
[[email protected] ]# firewall-cmd --list-services
cockpit ssh
netstat -anp | grep 22 shows the server is listening over 0:0:0:0:22
service sshd status shows the same (listening on port 22)
nmap -s... |
This is now working. For unknown reasons, the Port line in sshd_config was commented out.
# If you want to change the port on a SELinux system, you have to tell
# SELinux about this change.
# semanage port -a -t ssh_port_t -p tcp #PORTNUMBER
#
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
Chang... | firewall-cmd shows ssh enabled, but nmap from client shows port 22 closed (Connection Refused) |
1,561,648,719,000 |
I'm trying to ssh to my local sshd, but the connection is detected by sshd it closes before I get a password prompt.
The server is running buildroot and uses glibc.
I've compared the logs with working ssh/sshd logs, but the only difference I can find is the sudden exit after the method 'none', which does not give me a... |
According to this buildroot issue the call to clock_nanosleep_time64 or clock_gettime64 is problematic and causes:
The OpenSSH server on my device closes the connection abruptly
I'm able to login after adding this patch to the openssh source code before building.
| SSHD accepts connection but closes after method 'none' |
1,561,648,719,000 |
I'm on OpenBSD 6.8 and am running OpenSSH 8.4. How do I upgrade to OpenSSH 8.6, the newest version? Based off of this page https://www.openssh.com/openbsd.html , I know where to download it from, just not how. Where do I extract the .tar.gz to? Are there other steps besides just restarting sshd?
|
OpenSSH is part of the OpenBSD base system. The components of the base system are never upgraded individually, but always as part of a full base system upgrade. It is possible (by patching the base system's source code), but you will not get help from official OpenBSD mailing lists for your Frankenstein-system, and ... | How to upgrade to newer OpenSSH version on OpenBSD |
1,561,648,719,000 |
I have an SFTP server that runs on Amazon Linux 2 on AWS.
The current SSH version is OpenSSH_7.4p1, is it possible to safely upgrade this to version 7.8. If yes how can I get it done.
Since the SFTP server is already a production environment and has many users and applications connecting to it, I am worried if this up... |
This is solved. I followed the below blogs to complete and troubleshoot my openssh upgrade. I was doing it on amazon linux. However, I believe this should work on centos as well.
https://www.tecmint.com/install-openssh-server-from-source-in-linux/
https://blog.jonkimi.com/2020/04/17/Upgrade-openssh-server-on-Ubuntu/
h... | How can we safely upgrade SSH 7.4 to 7.8 on AmazonLinux2 |
1,561,648,719,000 |
I can't log into a clean Centos8 install on my VPS from the terminal using public key authentication.
When logging in it seems to authenticate OK, but then it times-out then returns a "Connection reset by [remote host ip address]" (not peer).
I've checked out all the logs. But nothing is really forthcoming.
Things I'v... |
I have some good news.
I raised an issue with my ISP. They've issued me with a new IP. I don't know what else they did but it has resolved the issue.
I have also raised an issue with redhat developers working on openssh.
They said this is a known issue especially in the VMWare community:
https://communities.vmware.com... | Can't SSH into openssh server version 7.8 and greater |
1,574,616,450,000 |
I'd like to, as the administrator of an OpenBSD ssh jumphost used by multiple people, run a specific command any time any user connects via SSH, even if just for tunneling.
Is this possible?
I've tried using ForceCommand and /etc/sshrc but these seem only to apply when the user has an interactive session and not other... |
You can monitor /var/log/authlog and use awk to send you a message whenever a specific line matches:
tail -f /var/log/authlog | awk '/Accepted pubkey/ { system("mail -s " $0 " [email protected] << EOF\nEOF") }'
You can of course replace /Accepted pubkey/ with some other pattern that fits your case. I chose to send e... | Run command on SSH server whenever a user connects, even if just for tunneling |
1,574,616,450,000 |
For my projects I have to customize the openssh code and I am planning to build the openssh-portable(https://github.com/openssh/openssh-portable) source code in the Alpine linux. But I am getting the following error while doing so.
*/home/openssh-portable # make
(cd openbsd-compat && make)
make[1]: Entering directory ... |
The issue seems to be with the fortify headers.
I am able to build openssh-portable successfully on Alpine 3.8 without issues:
Fresh alpine:3.8 image
Installed build prerequisites: apk add autoconf gcc make musl-dev openssl-dev zlib-dev
autoreconf && ./configure && make -j8
However, installing fortify-headers and ... | Can I build openssh-portable source code in Alpine linux |
1,574,616,450,000 |
The idea might be stupid or not feasible, I don't know, but I can't find any reference about this...
As you may know (and as SE definitely knows!), one of the common steps used to tighten SSH security, provided file access is enough, is to lock the user in a chroot. OpenSSH has been providing such a chroot-based jail... |
You should try that and report back how it works. In everything, there is somebody first one!
But my concern is that it would not work. The chroot from OpenSSH is called after all the key exchange, authentication and everything is done, but Systemd would force the namespaces even before starting the sshd process (if I... | Why do people still use SFTP jails based on SSH chroot rather than namespace capabilities of Systemd? [closed] |
1,574,616,450,000 |
I have a problem when ssh to another server.
I created ssh-key and copied it to other server.
-bash-4.2$ whoami
postgres
-bash-4.2$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/var/lib/pgsql/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase agai... |
I found solution at https://serverfault.com/questions/321534/public-key-authentication-fails-only-when-sshd-is-daemon
restorecon -r -vv /var/lib/pgsql/.ssh
command was enough.
I think problem occured because of SELinux.
Here is the restorecon command manual.
http://linux.die.net/man/8/restorecon
| SSH access asking for password in local network but public |
1,574,616,450,000 |
I need restrict session limit on my OpenSSH server only for one session (one connection). I use Ubuntu Desktop 7.10. Of course Version is old, but I need it for experimental purposes. I tried modify my config file - /etc/ssh/sshd_config two ways:
First I changed:
MaxStartups 1
but it does not work correctly. I can m... |
http://www.openssh.com/txt/release-5.1
The MaxSessions option was implemented on the version 5.1 of OpenSSH. Ubuntu 7.10 uses the version 4.6 so, this option will not be available to you. http://www.ubuntu.com/usn/usn-612-2/
Possible solutions:
Download a newer version of OpenSSH and comple it
Make a "apt-pinning" an... | Session limit for OpenSSH server on Ubuntu Desktop 7.10 |
1,574,616,450,000 |
I know I can add the following entry:
PubkeyAcceptedKeyTypes=+ssh-dss
to ~/.ssh/config as described here
but I need to do so for each entry. I want to enable it globally.
Is it possible ?
|
To enable it for all connections you personally make (rather than for all users on the system), just put it in your ~/.ssh/config one time:
Host *
PubkeyAcceptedKeyTypes=+ssh-dss
This will apply to all hosts unless overridden with a different PubkeyAcceptedKeyTypes setting in a subsequent specific Host clause. F... | Globally enable ssh-dss on openssh 7.0 |
1,574,616,450,000 |
i have some problems with the ssh proxycommand. The authentication on the proxy works fine, but when i want to login to the remote-host it fails. The problem seems to be, that the proxy tries to login with my local rsa_key and not with the key stored on the proxy. Is there a way to fix this?
This is what i want:
Loca... |
This probably isn't the answer you want to hear, but you can't do what you're trying to do.
The ProxyCommand option in ssh expects to STDIN & STDOUT of the command to be connected directly to the destination host (%h) and port (%p). Thus it is the local ssh process which is talking to the remote sshd, not the proxy ho... | Problems with SSH ProxyCommand [closed] |
1,574,616,450,000 |
I have ssh keypair on my ansible_host, which I want to copy to multiple user's authorized keys on target host.
I'm trying with-item construct, but it complaints about .pub key not an invalid key
here's what I'm trying.
- authorized_key:
user: "{{ item.user }}"
key: "{{ item.key }}"
with_items:
- { us... |
If you only need to copy your key to multiple users you can do it like that :
- authorized_key:
user: "{{ item.user }}"
key: "{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}"
with_items:
- { user: "user1" }
- { user: "user2" }
| ansible copy ssh keys to multiple users' home directory |
1,574,616,450,000 |
I have never seen this before in my sshd logs:
Mar 16 17:21:48 x-server sshd[9848]: Bad protocol version identification '\026\003\001' from 45.143.221.50 port 35026
Mar 16 17:21:48 x-server sshd[9849]: Bad protocol version identification '\026\003\001' from 45.143.221.50 port 35254
Mar 16 17:21:48 x-server sshd[9850]:... |
I have no idea about how it got past a NAT. But I will answer the rest.
A port is not a protocol: While ssh is usually on port 22, and http on port 80. This is only so we can find them easily. There is nothing fixed about these protocols and ports.
What seems to have happened is a web-browser (or web-spider) has tried... | What kind of an sshd attack is this? |
1,574,616,450,000 |
When I connect to a remote machine using ssh, my ssh agent will try all key files available in .ssh.
Per default, how many key files can the agent try for the log-in until server sends permission denied (publickey)?
|
From man sshd_config:
MaxAuthTries
Specifies the maximum number of authentication attempts permitted per connection. Once the number of failures reaches half this value, additional failures are logged. The default is 6.
My memory is that this has been consistent for many releases of OpenSSH, but as with any configur... | What is the default number of login attempts before login fail |
1,574,616,450,000 |
Background:
I have openSUSE Tumbleweed running on a local server (an old re-purposed HP desktop) and I am going to install LAMP and wordpress on it. I want to administrate the server remotely so I do not have to have a workstation set up for it. I also want to try out some penetration testing on the server, and I ha... |
ssh -v -p 222 and ssh -p 222 should return an error on their own. You need to specify a host to connect to, either by ip or by hostname (either qualified DNS name or something specified in /etc/hosts). For example, by IP:
ssh -v -p 222 192.168.0.3
You need to use the IP address of the openSUSE server.
| ssh -v -p 222 and other ssh suffix comands are not recognized in terminal |
1,574,616,450,000 |
I have a directory full of ssh private keys, and I'd like to check what keys are accepted on what server without logging in. How can I do that without adding the ssh-keys to my authentication client with ssh-add or logging in on the server? How does ssh know what keys it should try to authenticate with? Does the serve... |
You can use something like:
#!/bin/bash
KEYPATH=~/.ssh/*
HOSTS=( localhost hosta hostb )
probekey ()
{
for privkey in $KEYPATH
do
if [[ "$(file $privkey)" =~ "private" ]]
then
#echo "Probing key $privkey for host $1"
ssh -i "${privkey}" -o "IdentitiesOnly yes" -o "PreferredAuthent... | Check what ssh keys are accepted on server |
1,574,616,450,000 |
I set up a new server (hostname: odroid) and copied my public ed25519 key to it.
I signed to it for the first time and noticed 3 new entires have been added to ~/.ssh/known_hosts on my local machine:
odroid ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDnb0Xd02liZf5KJLuvmaQ/6Yo3Jsr4g427ly8AzmhjI
odroid ssh-rsa AAAAB3NzaC1yc2EA... |
Those are the server's host keys, by which your SSH client verifies that future connections aren't to some other server trying to impersonate this one. They have nothing to do with which key is used to authenticate your user to that server, or even whether you use a key at all.
While it may be possible to force your c... | Why are 3 entries added to ~/.ssh/known_hosts even though I use only a single key type? |
1,574,616,450,000 |
In this example:
$ ssh -L 8001:192.168.122.4:80
the output give is the default help:
usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface]
[-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
[-E log_file] [-e escape_char] [-F configfile] [-I pkcs11]
[-i identity_file] [-J ... |
The command is incomplete. As you can see in the usage page, the only mandatory argument is destination and you have not specified it.
-L 8001:192.168.122.4:80 is a parameter but it is not the destination.
Each ssh connection is independent, you really need to provide, for each one, at the very least, a destination. T... | Why does ssh port forwarding fail? |
1,574,616,450,000 |
A newer server admin tried to set me up to authenticate SSH using a public key. It wasn't configured correctly, and SSH kept asking me for password (and he kept telling me to hit enter). Unexpectedly, I am no longer able to connect to the server at all on any port. (It is a public web server.)
I spoke to the more se... |
After doing a lot of detective work and finally checking the list of running services more carefully:
systemctl list-units --type=service --all | grep running
I found that lfd.service (ConfigServer Firewall & Security - lfd) was running (not being a Linux sysadmin, I didn't know anything about it), and this turned ou... | After SSH authentication failures (Centos 7) something blocked my IP |
1,574,616,450,000 |
I've recently installed Kali linux on my Raspberry Pi 4, and I'm running into a problem that i can only ssh in after I log in to the kali user's desktop. This is an issue as I intend to run this headless most of the time.
Edit: To be more specific, before logging in, I get No route to host when trying to SSH into the ... |
A no route to host error message means the network interface is not up and running yet.
Have you perhaps saved your network configuration as per-user settings? If so, then NetworkManager won't have access to that network configuration until you log in, and so cannot set up the network interface.
If you configure the n... | SSH only starting after logging in to user in kali linux |
1,625,864,176,000 |
I have an Ubuntu 16.04.7 LTS where I get the following response upon dpkg-query:
dpkg-query -l 'openssh*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name ... |
This file gets installed when you install the openssh-server package (it's part of the postinst script).
Try running:
sudo apt-get install --reinstall openssh-server
| Unbuntu 16 does not have sshd_config |
1,625,864,176,000 |
Specifically, I have installed OpenSSH on both machines:
GNU/Linux Debian 9.3 with OpenSSH version 1:7.4p1-10+deb9u2
Linux Mint 18.3 with OpenSSH version 1:7.2p2-4ubuntu2.4
In this question, I read the following file is distributed with OpenSSH source code:
/etc/ssh/moduli
Presumably with the package(s). Am I right... |
That depends on your operation system. Debian-like systems ("like" Ubuntu) will most certainly ask you what to do with the file:
Configuration file `/etc/ssh/moduli'
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ... | Shall I hold the openssh packages after modifying /etc/ssh/moduli? |
1,625,864,176,000 |
The process of getting Putty communicating with OpenSSH has thwarted me for quite some time.
I installed OpenSSH with:
sudo apt-get install openssh
Then I generated ssh keys with:
ssh-keygen -t rsa -b 4096 -C "my user here"
The above command moved the public and private key combo to my user's profile home .ssh dir... |
I installed OpenSSH with:
sudo apt-get install openssh
The ssh server is in openssh-server package. SO either you do not have server installed and you are not connecting to your server or it was installed before.
The above command moved the public and private key combo to my user's profile home .ssh directory (/ho... | How do I communicate with OpenSSH on Linux from Putty on Windows? |
1,625,864,176,000 |
My problem is similar as the one described here.
I've three hosts A, B and C.
A is the computer I get at home.
B is a server that we have at the University which is connected to the Internet.
C is a computer in the Office of the University. Connected in the same local network with the server.
So I can SSH from A -> B ... |
First, here's better solution than the one given in the link provided in the question, since this new one has no dependencies on external tools like netcat:
Host C
ProxyCommand ssh -W %h:%p B
in the .ssh/config of host A. Users don't need to have specific computer skills, they just need to be informed. Anyone can p... | Implement SSH redirection on a remote host |
1,625,864,176,000 |
My goal is to build a LAMP server on my arch linux laptop. The main reason is for a web server. The other reason is to learn about how all this administration stuff works.
My setup is a laptop with Arch Linux. I deleted windows and am using only linux. I have one added user other than root.
My big question: Is it a go... |
One way of thinking of users are actual accounts which a person could log into on your server.
But a more common view of users, which you should get used to for administration, is more like a system role.
For example, if you install apache, you will see apache running as 'http' or 'apache' user. That is a legit user... | Setting Up SSH. Just need some understanding |
1,625,864,176,000 |
I have a zsh script with which I logged into a remote host to copy some folders. The system asks me each time to give the password of the local host which I want to bypass, otherwise I have to enter the passphrase many times.
I followed the following tutorial:
https://www.thegeekstuff.com/2008/06/perform-ssh-and-scp-w... |
You need to run the local ssh-agent. And in the "I tried to log again" you forgot the -l (or, alternatively, jsmith@remote-host).
There's a good chance that you did start the agent and did the ssh-add part, too, but in a different session. What I do is to invoke eval $(ssh-agent -s) from my window-managers initialisat... | Log in to remote server by using a generated public key |
1,625,864,176,000 |
I am exploring methods to correlate my current SSH session with the SSHD logs.
I aim to extract specific information from the SSHD logs that pertain to my SSH session only.
Jul 04 09:39:06 linuxbox sshd[1122]: Accepted publickey for testuser from 1.2.3.4 port 123 ssh2: RSA-CERT ID test (serial 1) CA RSA fingerprint...... |
To get the PID of your current session, you can use pstree with the -s flag ("show parents of the selected process").
$ pstree -sp $$
systemd(1)───sshd(1583)───sshd(30575)───sshd(30577)───tcsh(30579)───pstree(30915)
The relevant PID of your session is the child of the main PID sshd process, which you can find using:
... | How can I map the sshd logs to my current ssh session? |
1,625,864,176,000 |
At first, I'd like to note that I am aware that there are a lot of other questions regarding SSH agent forwarding. The people there wanted to know how to make agent forwarding work or how to configure it securely. But I have the opposite problem: It seems that I can't reliably disable it. So here we go:
I am running a... |
It only says that the agent forwarding would be possible with the key (default), had the agent forwarding been enabled globally (what it is not).
The log entry shows only result of parsing the authorized_keys file.
It basically says that no-agent-forwarding flag was NOT found at the respective entry. It in no way ref... | Meaning of "key options: agent-forwarding" in OpenSSH logging |
1,625,864,176,000 |
I have a system user syncoid as
$ cat /etc/passwd
syncoid:x:993:990::/var/lib/syncoid:/run/current-system/sw/bin/nologin
with the following ssh config:
$ cat /var/lib/syncoid/.ssh/config
Host eve
User other
HostName 192.168.10.1
ProxyJump jumphost
IdentityFile /var/lib/syncoid/.ssh/eve-syncoid
Host jumphost
... |
This is actually not a ProxyJump problem - the service is a hardened systemd service with a limited RootDirectory, so it cannot access the private ssh key.
The folder with the private key has to be added to the BindReadonlyPaths following this github comment
config.services.syncoid.service.serviceConfig.BindReadOnlyPa... | SSH: ProxyJump from user without shell |
1,625,864,176,000 |
If I set a custom path for AuthorizedKeysFile, how does sshd decide which user this key belongs to?
AuthorizedKeysFile
Specifies the file that contains the public keys that can be used for user authentication. AuthorizedKeysFile may contain tokens of the form %T which are substituted during connection setup. The foll... |
sshd doesn’t need to decide which user a key belongs to; it knows which user is attempting to connect (user on the target system), and it knows which key is provided in the attempt.
After expansion, the file pointed to by AuthorizedKeysFile is used to determine whether the provided key is allowed for the target user. ... | How does sshd know which user belongs to which AuthorizedKeysFile? |
1,625,864,176,000 |
I have two machines devbox, and gitbox. The second machine, gitbox is a development box that has no shell, and is very locked down just to afford git over ssh (there isn't access to /bin/true even)
What I want to do is add to devbox's .ssh/known_hosts the entry for gitbox. Currently what I do is,
ssh -oStrictHostKeyCh... |
Try ssh-keyscan , then append the output to ~/.ssh/known_hosts
ssh-keyscan git.server.com >> ~/.ssh/known_hosts
| Simply adding to SSH known_host without forcing an error? |
1,625,864,176,000 |
I'am running a script to connect to another host (via ssh) and it's doing some deployment work.
I need to detect the ssh connection is closed/or interrupted, then need to execute a command to delete session_directories in the remote host.
I was trying pam_session_close, but it can remove directories with the ssh sess... |
You could run a script that uses trap on SIGHUP.
| Probe SSH connection and detect ssh disconnect or logout |
1,625,864,176,000 |
I've just set up OpenSSH on my system (Ubuntu 18.04 LTS), and generated the key using ssh-keygen. When prompted for password, I set it to just one character to test, but when I try to copy the public key onto the server, it keeps saying:
ssh-copy-id user@ip
/usr/bin/ssh-copy-id: INFO: attempting to log in with the ne... |
You just generated a new key. You can not use that key to connect to a remote host since the public key is not available on it yet. To copy the key, you will have to use your user's password on that host (unless it has another of your public SSH keys already, which I in this case doubt), not the password for the key.... | SSH password permission denied |
1,625,864,176,000 |
I have fresh installed Manjaro version 17. Then I install OpenSSH, My aim is to start SSH on boot. SO I did below
sudo pacman -Sy openssh
sudo systemctl start sshd.service
sudo systemctl enable sshd.service
I enable Firewall too, at every boot I have to login to system than only I can connect to SSH. I also enable ... |
You should use netctl. It is the Arch Linux built in network management system. If it isn't already installed (it should be though), run pacman -Syu netctl then look in /etc/netctl.
There are example configuration files in /etc/netctl/examples. To use an example, just copy it to /etc/netctl and edit it to fit you... | Manjaro Connect SSH & Wifi before log in |
1,625,864,176,000 |
When I connect to my computer over ssh on the local network, putty fives me the correct fingerprint of
ssh-rsa 2048 ad:e3:4c:e3:d0:6f:81:2e:05:94:77:6c:0f:2c:a8:7f
This matches the fingerprint on my computer when I run ssh-keygen -E md5 -lf /etc/ssh/ssh_host_rsa_key.pub
When I connect over the internet putty gives me... |
If you cannot confirm that key fingerprint as coming from your ubuntu host, the likely cause is that you are not really connecting to the host/service that you think you are.
Not only are you getting a different host key, the key length of 1040 seems a bit peculiar. Doing a quick google search on the fingerprint 86:03... | Why are there 2 different fingerprints for ssh depending on what network I connect from? |
1,625,864,176,000 |
I have Linux mint on my pc.
I have a public/private key pair to ssh into my router without having to type the password.
It works on Windows using putty, but Mint isn't when I run it from terminal.
ssh -i privkey.ppk [email protected]
|
You need to convert keys generated by putty to a form that can be used by openssh.
There are several good answers explaining various ways of doing this at https://stackoverflow.com/questions/2224066/how-to-convert-ssh-keypairs-generated-using-puttygenwindows-into-key-pairs-use
| Why am I still being asked for an ssh password when I'm using private key authentication? |
1,625,864,176,000 |
Question is simple:
What are the (private) key types and (their specification - format, syntax) accepted by current openSSH?
The vague answer "the keys generated by ssh-keygen" is not accepted - I know it. They are called PEM with such headers (RSA, DSA, ECDSA variations):
-----BEGIN RSA PRIVATE KEY-----
The other ... |
TL;DR
The most helpful comments from @forcefsck. Unfortunately he didn't fill the answer so I was unable to award the bounty. In short, the answer is PEM + RSA1 + new openSSH format which is described in the question and the main problem was with PEM.
The long one & Bonus
OpenSSH is using parser from openSSL (PEM_read... | What are the keys accepted by openSSH? |
1,625,864,176,000 |
Anyone know how to make ssh source the users enviroment?
ssh -Y -t old-dash '"bundle exec rails server"
bash: bundle exec rails server: command not found
Connection to old-dash closed.
one@localhost ~/github/ui $
I have the below in my .bashrc and I do not think it is getting sourced:
export PATH="$HOME/.rbenv/bin... |
See if this helps you.
ssh <host> bash --login -c <command>
Start bash as a login shell through SSH and then load the rbenv via SSH's -c option.
| SSH run command in users rbenv enviroment |
1,625,864,176,000 |
So I've installed OpenSSH on Mint rafaela 17.2, but it doesn't seem to be running when using the modified config file.
Not sure why service says its up, but I don't have a PID, don't have a listener, and can't connect at all...
service --status-all shows [-] ssh.
service ssh start returns start:
Job is already runni... |
Sort of figured it out. Obviously something in the config file was stopping the server from starting.
After implementing each file change one line at a time, finally found it was the ForwardAgent no line in the config that was causing problems.
After some more digging, found that you could start the daemon direct ins... | Installed OpenSSH on Mint 17 but it doesn't seem to be running |
1,625,864,176,000 |
I have a chrooted SFTP user group to access my home server. The chroot location is /mnt/, mostly because it is already owned by root and is where I have mounted the external HDD I want to the chrooted user group to access. Moreover, I got 'Permission Denied' errors when I had the chroot directory at /home/[user] (even... |
Copy them in as root and then chown them to the required owner.
| SFTP Chroot and SSH |
1,625,864,176,000 |
I am running Ubuntu 22.04.3 with an sFTP server configured through SSHD.
I have several user home directories each with a dropoff and a pickup folder inside of them.
While my admin user is able to navigate the server and view the contents of any directory. The admin is unable to add or remove any files from the other ... |
Based on the comments, what you call "admin user" should rather be called something like a "FTP/SFTP janitor user".
You should create a group for this purpose, and make both the "admin user" and the users that have pickup/dropoff directories members of that group.
The sftp group is not suitable for this purpose, becau... | sFTP admin permission denied when placing files into user directory |
1,625,864,176,000 |
By now, we are using OpenSSH GSSAPI authentication on all of our servers (Debian from 10 to 12).
Then we sudo -i, using ldap authentication (through sssd-ldap).
I would like to get rid of the ldap authentication and rely on GSSAPI only, both for OpenSSH and Sudo.
The idea is to to forward Ticket service to Openssh (ho... |
Is there a way to keep the ticket service forwarded to openssh inside a credential cache? It would help me to authenticate sudo afterward.
No, there's no option to do that. (It would be possible in theory, but it's not an implemented function.)
However, it might be possible to use PAM to acquire a "S4U2self" ticket,... | How to authenticate through OpenSSH then sudo with only one Ticket Service (Kerberos TGS host/fqdn) |
1,625,864,176,000 |
I made my Arcolinux (5.12.14-arch1-1 x86_64) unusable by trying to install openssh. Googled a few hours and tried something, but without success.
I did the following:
$sudo pacman -S openvpn
Then vpn sayed that it requires oppenssl, so I installed it
$sudo pacman -S openssl
Then I tried to start openvpn and got an e... |
Based on your kernel version (5.12.14-arch1-1 x86_64) you apparently haven't updated your Arch installation in about 15 months.
Keeping up with a rolling-release distribution like Arch tends to require frequent updating. The distribution maintainers cannot guarantee that you will be able to install the newest packages... | Missing libraries after installing openssl (libcrypto.so.1.1, ...) |
1,625,864,176,000 |
I used that form to create my ssh key : ssh-keygen -t ed25519 -C "[email protected]" and I got: Encryption: aes256-cbc, is it possible to use [email protected] instead?
thanks
|
man 1 ssh-keygen states :
-Z cipher
Specifies the cipher to use for encryption when writing an
OpenSSH-format private key file. The list of available
ciphers may be obtained using "ssh -Q cipher". The default
is “aes256-ctr”.
ssh-keygen -t ed25519 -Z "[email protected]" -C "[em... | How to generate ssh key with AES-GCM? |
1,625,864,176,000 |
I read this question
Get SSH server key fingerprint
In the answer and solution appears the following command (adapted here for presentation purposes)
ssh-keyscan 192.168.1.X | ssh-keygen -lf -
I know that the first command isolated shows the public keys of the host. When the complete command is executed - thus the ... |
By default, ssh-keygen -l will ask you interactively for what public key file to show the fingerprint of. With -f you give it the pathname of some existing file instead.
If the pathname is - (a dash), input is read from standard input instead of from a file.
This is a common practice that quite a few other commands a... | How does "-" work in the "ssh-keygen -lf -" command? |
1,625,864,176,000 |
I read this question:
How do I extract fingerprints from .ssh/known_hosts?
The answer is valid, so I tried some variations:
ssh-keygen -lf ~/.ssh/known_hosts -F 192.168.1.X
ssh-keygen -lvf ~/.ssh/known_hosts -F 192.168.1.X
ssh-keygen -E md5 -lvf ~/.ssh/known_hosts -F 192.168.1.X
ssh-keygen... |
In Korn-like shells, you could always do:
ssh-keygen -lf <(grep ' ssh-rsa ' ~/.ssh/known_hosts) -F localhost
Same with fish:
ssh-keygen -lf (grep ' ssh-rsa ' ~/.ssh/known_hosts|psub) -F localhost
Or other shells assuming a system that has /dev/stdin (most these days):
grep ' ssh-rsa ' ~/.ssh/known_hosts | ssh-keygen... | How do I extract fingerprints from .ssh/known_hosts? but filtering for a specific key type |
1,625,864,176,000 |
In Ubuntu and Fedora in the /etc/ssh/ directory exists the following files:
ssh_host_key
ssh_host_dsa_key (not available in Fedora)
ssh_host_ecdsa_key
ssh_host_ed25519_key
ssh_host_rsa_key
For the same set of these files, exists others with the same names but with the .pub extension.
I know that dsa, ecdsa, ed25519 a... |
ssh_host_key is the key for the deprecated OpenSSH protocol version 1. It is always RSA.
-h host_key_file
Specifies a file from which a host key is read. […] The default is /etc/ssh/ssh_host_key for protocol version 1, […]
— man 8 sshd
| What is the key type for the ssh_host_key file in SSH? |
1,625,864,176,000 |
I have the following problem:
I have a remote machine accessible via ssh which can serve some data through a web interface.
I can use OpenSSH LocalForwarding to open a tunnel and start the remote server:
ssh [email protected] -L 127.0.0.1:3333:localhost:4000 ./start.sh
then, on another terminal (or from GUI), I can s... |
It turns out answer is a bit more convoluted than expected.
I ended up writing a full init script for the server:
#!/bin/sh
# use start-stop-daemon to control zero-ui
set -e
# Must be a valid filename
NAME=zero-ui
PIDFILE=/home/user/$NAME.pid
DAEMON=/usr/bin/node
DAEMON_OPTS="/home/user/zero-ui/backend/bin/www"
exp... | opening a temporary tunnel |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.