• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue I messed up, can't access ssh/sftp

filipetakanap

New Pleskian
Server operating system version
CentOS Linux 8.5.2111
Plesk version and microupdate number
18.0.41
Hey,

I did a dumb thing which was to add on /etc/ssh/sshd_config a line "AllowUsers developer"
And now i can't access the server with root by ssh or sftp.

I was trying unsecure FTP (which uses not ssh), but for some reason it keeps trying to connect but fails in the end.
In security i've enabled "allow only non-secure FTP".


Would appreciate some help
 
There are a number of workarounds. I assume you are "admin" of your server? Here are some ideas how to gain access again, probably there are even more ways:

For one you can login through SSH using the "developer" user name if it exists. Once logged in you can escalate your privileges with su to gain root access.

If a "developer" user does not yet exist, you could login to Plesk, create a subscription and grant the subscription full SSH privileges. Then you need to rename the system user of that subscription to "developer". From there you can either login with "developer" as described above or you can use the SSH extension to login through the GUI.

If that fails, maybe you can let a PHP script do the work. The only prerequisite is that open_basedir in your subscription account is disabled. As you are "admin" you can disable that for your special subscription that you use to gain access again. Then let your script edit the sshd_config file for you.

If that fails, e.g. for reasons of missing permissions, maybe your data center offers a "rescue mode" into which you can boot your system. From there you can mount your disk, edit the sshd_config file, then reboot into your normal system.

If that fails, maybe your data center offers a KVM console. That is a device that connects externally to your server and gives you remote hands access as if you were sitting right in front of the machine. It does not need direct network access to the machine, because the external console lets you login as if you were sitting right there in front of it. Could work maybe.

If that fails, I suggest installing the Plesk SSH Support extension and open a ticket with Plesk. Because Plesk staff may be able to bypass the user name limit. Not perfectly sure, but it could work.
 
Back
Top