Questions tagged as ['ssh']

Secure Shell (SSH) is a protocol primarily for encrypted shell connections. This tag is also used for questions about sshd and openssh, the two standard applications for using SSH.
Score: 0
Patrick Bucher avatar
Gitea offers wrong SSH key
in flag

I'm running Gitea on a virtual machine that is publicly accessible under gitea.myorg.foo. Here's the server part relevant to my SSH configuration of my configuration file:

[server]                                                                                                                       
SSH_DOMAIN       = gitea.myorg.foo                                                                           ...
Score: 0
Old Geezer avatar
AWS Ubuntu instance keeps dropping ssh connections
us flag

My AWS LightSail Ubuntu instances used to allow my ssh clients to stay connected forever. However, a newly created Ubuntu 20.04 instance now keeps dropping the ssh connection, even though connections on the same PC to other cloud Ubuntu instances remain uninterrupted. I am unable to tell whether it is due to inactivity.

I check /etc/ssh/sshd_config and the following are all unset:

#TCPKeepAlive yes ...
Score: 0
antimatter avatar
How to setup ssh public key for another machine without access?
pk flag

This might be a stupid question but I have to ask it anyway:
I already did setup an ssh public key for my client machine A. I copied the public key to the remote server, everything works fine, I can log in from machine A.

Now I also want to access that server from another machine and following best practices, I wanted to generate another key for client machine B, rather than using the key from machine  ...

Score: 0
J.Do avatar
scp from Windows Server to Unix server works but not the other way around
cn flag

I installed OpenSSH on my Windows Server machine to use SSH. To test this out, I ran this command from my windows server.

scp test.txt user@unixserver.company.com:/path

Which worked, I can see the file on unix via putty. However, if I run this command on the unix server:

scp index.txt user@windowserver.company.com:/path

It doesn't work. It hangs for a long time and eventually I get:

ssh: connec ...
Score: 9
AhmedWas avatar
How can I know if the current running SSH server is OpenSSH or Dropbear?
in flag

If I go inside the file /etc/ssh/ssh_config, I can see "$OpenBSD" at the top of file. However, if I change the default port to a different value, it doesn't seem to work. A colleague informed me that's because Dropbear is the software server here, not OpenSSH.

Is there a way to be sure? I can't find an answer googling that.

Score: -2
Regan Wagner avatar
Is there anyone successfully running a mail server in google cloud?
in flag

Mail servers cannot resolve to my SMTP mail server in google cloud. Can someone please help? Its a mailcow server

Score: 0
Awaish Kumar avatar
Server goes down after every few hours - No route to host
in flag

I have a Ubuntu machine, it keep going down after some(10-15) hours. It returns the error as no route to host when I try to SSH. But it works when I restart from hetzner console and again after few hours it goes down.

I checked:

  1. syslogs: there are lots of IPs trying to connect to machine but are being blocked by firewall (UFW).
  2. I checked auth.log but I could not find any suspicious login.
  3. I chec ...
Score: 0
Giovanni Passetti avatar
KVM bridged guest ssh permission denied
aw flag

I am able to ping my virtual machine and also have a satisfying response from ssh service using telnet, but I get 'permission denied' error whenever I attempt a ssh connection from a remote host. Connection is just fine when connecting in loopback on 127.0.0.1 with the same credentials.

Any hints?

Score: 0
Asmodean avatar
Guacamole ssh into localhost Config
us flag

So I installed the apache guacamole and got the tightvnc service, which is also on the same machine as guac to connect and work perfectly.

Problem is when I try to set up a connection for a ssh into the local machine, 127.0.0.1 didn't work. Nor if I enetered the actual ip of the server.

The fields like key and key passphrase are provided correctly. And the user (not root) without and with a password ...

Score: 0
ke xu avatar
SSH forwarding works on local but fails for the remote
au flag

I made a port SSH local forwarding on a remote machine:

ssh -N -L 127.0.0.1:3388:127.0.0.1:22 localhost

it works on the remote machine itself:

telnet localhost 3388

returns

Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
SSH-2.0-OpenSSH_7.4

However, when I use this forwarding from the local machine:

telnet remote.ip 3388

it fails:

Trying remote.ip...
telnet: Unable to conne ...
Score: 0
Triforcer avatar
SSH tunnel HTTP/S, client connections stuck in FIN_WAIT2 status
jp flag

I've set up a tunnel successfully between two servers, such that incoming connections on port 80/443 are forwarded to another server that is actually running the webserver. Further, I've used autossh to maintain the connection.

This works great, except that instead of closing fully, many of the incoming connections end up in a state of FIN_WAIT2:

sample netstat output

..and since they are associated  ...

Score: 0
Ror avatar
Restart services on multiple remote servers securely
om flag
Ror

I need to write a script so that my colleagues and myself can restart different services on multiple servers. We all connect to the servers with LDAP so i'd like my script to connect our LDAP users to the server and then use sudo to restart the services (I can write a script on each server to restart all the services needed). Right now the script simply run a command like

ssh -t user@host "sudo ser ...
Score: 0
Host key verification failed SSH Github
cn flag

I've taken a relatively simple approach to try and securely clone my GitHub repo but still struggling.

On My Mac I ran specifying name as MyKey and no password

ssh-keygen -t rsa

I uploaded the contents of the public key to GitHub with read and write access. Then I ran the following commands on my server:

cat > /root/.ssh/github.id_rsa << EOF
-----BEGIN OPENSSH PRIVATE KEY-----
The private k ...
Score: -1
How can I reset share passwords for WD Sharespace using root in SSH?
us flag

I have a Western Digital ShareSpace Disk Array NAS (Same one in this manual : https://docs.rs-online.com/49a1/0900766b80ce7e97.pdf )

The system has an existing number of shares, with a lot of files and data. Each share was created through the web interface of the NAS and each has its own username and password.

I am able to login to the NAS SSH interface (as root) and when I run the command

less /etc/passw ...
Score: 0
Tony avatar
Disabling certain OpenSSH keys on OpenBSD: why the corresponding 'sshd_config' entries are ignored and why 'ssh-keygen -A' generates forbidden keys?
cn flag

I am trying to achieve the followings on my OpenBSD 6.9 servers:

  1. Forbidding the use of all keys but the ssh-ed25519 one on both SERVER and CLIENT sides.
  2. Limiting ssh-keygen -A to generate keys only by the authorised ssh-ed25519 algorithm and nothing else.

In order to achieve these, I have added the following lines to my sshd_config:

HostKey /etc/ssh/ssh_host_ed25519_key
CASignatureAlgorithms ssh-ed2551 ...
Score: 0
rk92 avatar
Allow users in chroot to SSH to another VM instance
tr flag

Been coming across some issues with setting up SSH from a chroot directory out to a secondary VM. This is all being done in Google Cloud at the moment using CentOS 8. I think I have created the chroot directory correctly, added /bin/ssh to the chroot directory, added shared libraries for /bin/ssh.

I am stuck currently at running ssh <IP_ADDRESS>. I had to first create a /home/<USER>/.ssh ...

Score: 0
dywan666 avatar
Where to store private SSH keys?
hu flag

Looking for a "best-practices" kind of answer when it comes to storing private SSH keys.

Scenario: VMs are deployed to the cloud using Terraform, they use a single public key. Now the corresponding private key needs to be stored somewhere - where should it be kept? Cloud key management service (like Azure Key Vault, Hashicorp Vault)? It would be used for Ansible.

Should these private keys be added to t ...

Score: 0
The ssh agent cannot 'resolve hostname' when called from within a bash script
ru flag

I have a bash script

#!/bin/bash
scp -r some_directory remote_host:~

which I made executable with chmod u+x. The remote_host has been defined in my .ssh/config as follows:

Host remote_host
HostName ec2-x-xxx-xx-xxx.eu-central-1.compute.amazonaws.com
User ubuntu
IdentityFile ~/path_to_pem_file/pem_file.pem
IdentitiesOnly yes

when I call scp -r some_directory remote_host:~ or ssh remote_host it works w ...

Score: 1
LinuxSecurityFreak avatar
fail2ban initial setup - guidance
ru flag

From my basic understanding of iptables I put together the below setup intended to run a Tor relay... here it is after 6 hours approx. Please note, I do not want to discuss any Tor operations, and so I shall not be pointed to https://tor.stackexchange.com/ Thank you.

There was a large attack on port 22, which I spotted when I woke up, so I've changed it, password authentication was already disabled, bu ...

Score: 2
DJ_Ironic avatar
SSH tunnel reconnecting after WAN change or server drop
cn flag

I am fighting with autoSSH configuration.

My setup

  1. VPS as a public contact point, clients will access the VPS IP to get to the server
  2. My home server running the service. This machine has dualwan connectivity - so it can switch to another ISP if the first one drop. (IP address will change)

I want to make a SSH tunnel that will automatically reconnect when the connectivity is switched or one of those  ...

Score: 0
Gromit avatar
How can I create an upload-only SFTP Server on Windows?
us flag

I need to create an upload-only SFTP Server on Windows. I have installed OpenSSH SFTP Server according to https://manage.accuwebhosting.com/knowledgebase/3627/How-to-setup-SFTP-on-Windows-Server-2016.html, but I can't set the folder permissions in a way that would allow the user to list folders, but not read data.

It was very easy to do for FTPS using Filezilla Server - you can set the permissions in  ...

Score: 1
xiaojueguan avatar
Display not adjusts it self with ssh connected to a container in linux server after i resize the font size in item2
in flag

Problem description:

I was using ssh connecting to a linux server and use docker exec -u root -it container-name bash to login into the container with item2. The display failed to resize itself after I changed the font size. And it looks like below: enter image description here

Things tried:

  1. Change the setting in the server
shopt -s checkwinsize
  1. Change some configuration of item2 like preferences -> advanced -> Termina ...
Score: 1
Takeshinho avatar
SSH to 1 server from 2 different servers which have same hostname
cn flag

There is 2 servers for production and DR. Both servers are RHEL 7 and same spec.

Both have same host name and different IP address. We need to connect to same outside servers over SSH without password.

When we tried to connect from DR server, it showed warning with message as below.

Permission denied (publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive).
fromserver:user1$ ssh  user2@dest-ser ...
Score: 0
tengatoise avatar
Ssh portforwarding options are working in the command line but not when using ssh config file
jp flag

This works in the command line.

ssh -i ~/.ssh/id_rsa x.x.x.x -p 22 -R <IP1>:10001:localhost:9090 -R <IP2>:10001:localhost:22

But when using the ssh config file, it fails. Below is the contents of the config file.

Host decryptor
  HostName      x.x.x.x
  User          sshtunnel
  Port          10022
  IdentityFile  ~/.ssh/id_rsa
  RemoteForward <IP1>:10001 localhost:9090
  Remote ...
Score: 0
Suddenly SSH on all google cloud computing instance is stopped - I can't get it fixed
ky flag

I am passing a very hard time connecting VM instances on google cloud. Everything was fine, suddenly the VM is refused to connect, I can't get it to be fixed.

I have run this command in cloud shell :

gcloud beta compute ssh ceunix-ubuntu-server-instance -- -vvv 

and get the following message:

Welcome to Cloud Shell! Type "help" to get started.
Your Cloud Platform project in this session is set to ceuni ...
Score: 0
writingdeveloper avatar
How to specify SSHFS capacity
ua flag

Is there anyway to set SSHFS volume size with option cmd's?

I already tried to find option cmd's in https://linux.die.net/man/1/sshfs but it seems that there are no settings for that.

But some SFTP clients have quota function to set virtual volume size. How do they make it?

Score: 1
Tracy avatar
Can't SSH into my server from my Mac Terminal and rsync over SSH is suddenly broken too
dj flag

all of a sudden I can't login to my server from my Mac Terminal. On my Linux machine normal ssh login still works, except rsync over ssh also gets stuck.

This is what happenes when I try to connect from my Mac:

ssh -v user@xx.xx.xx.xx
OpenSSH_7.8p1, LibreSSL 2.6.2
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to xx ...
Score: 0
vinzee avatar
How to forward port 8080 from a distant server to the client from the client using a tunnel ssh?
ke flag

I have installed GitLab in docker on a distant machine. I would now like to forward the port 8080 from this distant machine to my local port 8080.

On the distant machine:

sudo docker run --detach --hostname gitlab.example.com --publish 443:443 --publish 8080:80 --publish 2222:22 --name gitlab --restart always --volume $GITLAB_HOME/config:/etc/gitlab --volume $GITLAB_HOME/logs:/var/log/gitlab --volume $GI ...
Score: 17
Ali avatar
How can I protect SSH?
id flag
Ali

I check /var/log/secure and I have these logs:

Jul  9 13:02:56 localhost sshd[30624]: Invalid user admin from 223.196.172.1 port 37566
Jul  9 13:02:57 localhost sshd[30624]: Connection closed by invalid user admin 223.196.172.1    port 37566 [preauth]
Jul  9 13:03:05 localhost sshd[30626]: Invalid user admin from 223.196.174.150 port 61445
Jul  9 13:03:05 localhost sshd[30626]: Connection closed by ...
Score: 1
patrik avatar
How do I log to both console and log file with OpenSSH sshd?
mx flag

Due to some circumstances we need to log OpenSSH sshd output to console, but we would also want to be able to log it to file. This would be something like running sshd -e -E /path/to/file.log .... However, it seems as if -E is overriding, so if used, it will not log to console.

Is it possible to configure sshd to do both at the same time?
BR
Patrik