Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

/etc/ssh/sshd_config disappears on upgrade to 1.5.1 when using a non-default console #2672

Closed
dwaite opened this issue Feb 11, 2019 · 9 comments

Comments

@dwaite
Copy link

dwaite commented Feb 11, 2019

Upon upgrade, ssh is no longer accepted. It appears /etc/ssh/sshd_config disappears on each reboot.


RancherOS Version: (ros os version)
1.5.1

Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.)
digitalocean (via droplet Gui deployment)

@kjake
Copy link

kjake commented Feb 11, 2019

I have the same behavior. 1.5.1 running on VMware. Using Debian console.

@nlseven
Copy link

nlseven commented Feb 12, 2019

Same here, running VMware build.
I have added the sshd_config to the cloud-config.yml before upgrading nodes, which is working fine:

write_files:
- content: |+
    ChallengeResponseAuthentication no
    UsePAM yes
    X11Forwarding no
    PrintMotd no
    AcceptEnv LANG LC_*
    Subsystem sftp /usr/lib/openssh/sftp-server
    ClientAliveInterval 180
    UseDNS no
    PermitRootLogin no
    ServerKeyBits 2048
    AllowGroups docker
  owner: root
  path: /etc/ssh/sshd_config
  permissions: "0600"

@kjake
Copy link

kjake commented Feb 12, 2019

Thanks @nlseven - since mine was already broken, it didn't like that formatting and wouldn't take on reboot.

I did it this way though, rebooted, and it took and was reformatted like yours - so there's something about cloud-config that I don't understand.

My sshd_config persists through reboots now, but only contains what you've posted.

write_files:
  - path: /etc/ssh/sshd_config
    permissions: "0600"
    owner: root
    content: |+
        ChallengeResponseAuthentication no
        UsePAM yes
        X11Forwarding no
        PrintMotd no
        AcceptEnv LANG LC_*
        Subsystem	sftp	/usr/lib/openssh/sftp-server
        ClientAliveInterval 180
        UseDNS no
        PermitRootLogin no
        ServerKeyBits 2048
        AllowGroups docker

@nlseven
Copy link

nlseven commented Feb 12, 2019

Thanks @nlseven - since mine was already broken, it didn't like that formatting and wouldn't take on reboot.

I did it this way though, rebooted, and it took and was reformatted like yours - so there's something about cloud-config that I don't understand.

My sshd_config persists through reboots now, but only contains what you've posted.

No problem. I grabbed the sshd_config file from a working 1.5.0 node and stripped the comments, so this is using the regular Rancher defaults. The upside is that it won't tack on the last 5 lines on each reboot like the old version sometimes does.

@niusmallnan
Copy link
Contributor

This should happen when using a non-default console.

You can upgrade with --upgrade-console, this should work:

ros os upgrade --upgrade-console

But it will delete the old console, please back up your data.

I will update the RN to remind other users.

@niusmallnan niusmallnan changed the title /etc/ssh/sshd_config disappears on upgrade to 1.5.1 /etc/ssh/sshd_config disappears on upgrade to 1.5.1 when using a non-default console Feb 12, 2019
@niusmallnan niusmallnan added this to the v1.6.0 milestone Feb 12, 2019
@dwaite
Copy link
Author

dwaite commented Feb 12, 2019

@niusmallnan yes, --upgrade-console fixed it for me. I couldn't figure out the magic in ros to get a new version of the console.

@benok
Copy link

benok commented Feb 22, 2019

I submit a issue #2683 around this.

@benok
Copy link

benok commented Feb 22, 2019

Sorry, #2683 is not actually related.

@rootwuj
Copy link

rootwuj commented May 21, 2019

Tested with rancher/os:v1.5.2-rc1 from May 21
Verified fixed

Test:

  • Rancheros v1.5.1 switch to other console
  • Upgrade to rancheros v1.5.2-rc1

Result:

  • can connect via ssh
  • /etc/ssh/sshd_config exists

@rootwuj rootwuj closed this as completed May 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants