Cannot enable SSH on Google Cloud downloaded centos vmdk on VirtualBox
Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The configuration looks normal. Have you changed 'usedns' though?
The log output shows that sshd runs and appears to be listening on all interfaces.
Two more questions while waiting for the strace:
Can you SSH to it from the same machine which it is on using the local host address?
Can you SSH to it from the same machine which it is on using an external address?
using the localhost address, ssh user@localhost gives connection refused on port 2222. Tried /usr/sbin/sshd -ddd , but this time the process is not getting started. bad day... please help.
Not that, I am trying on a different port 2222 other than port 22 for testing purpose, but no luck.
Mind to change port so it does not conflict with any other alrdy in use.
Code:
/etc/default/dropbear
# the TCP port that Dropbear listens on
DROPBEAR_PORT=22
Let us know about results.
Dropbear is working amazingly, no issue so far on doing SSH, but cannot do SFTP, it requires the openssh, any idea how to get sftp work with dropbear? I got some guide but they instructed to compile.
You can try to reuse your existing sftp server but keep in mind it belongs to OpenSSH, so in your case it is likely it wont work.
On the Droprear config file, find the section for SFTP and add following one:
Code:
/usr/libexec/openssh/sftp-server
Note: this should be default path for sftp-server on RHEL but I dont have any RHEL here at the moment, so to confirm, execute this:
Code:
find /usr -type f -iname "*sftp-server*"
Note2: if you can use SCP instead of SFTP, then it should work by default with Dropbear.
You can try to reuse your existing sftp server but keep in mind it belongs to OpenSSH, so in your case it is likely it wont work.
On the Droprear config file, find the section for SFTP and add following one:
Code:
/usr/libexec/openssh/sftp-server
Note: this should be default path for sftp-server on RHEL but I dont have any RHEL here at the moment, so to confirm, execute this:
Code:
find /usr -type f -iname "*sftp-server*"
Note2: if you can use SCP instead of SFTP, then it should work by default with Dropbear.
my dropbear config at /etc/default/dropbear was fully blank, I added the port config as per your code, but for SFTP I don't know how to write, but i did the below:
Code:
SFTPSERVER_PATH=/usr/libexec/openssh/sftp-server
I found the sftp-server path there.
Can you provide me a complete dropbear config file which I can use as per my need and other comment out?
And I am getting the following error when doing sftp from my local machine:
Code:
bash: /usr/libexec/sftp-server: No such file or directory
Connection closed
It means my local machine is looking for the sftp on /usr/libexec, but on the actual cloud VM, the sftp location is at /usr/libexec/openssh directory
can I just mv them to the required directory? will it work?
Last edited by islammanjurul; 11-19-2020 at 05:00 AM.
my dropbear config at /etc/default/dropbear was fully blank, I added the port config as per your code, but for SFTP I don't know how to write, but i did the below:
Code:
SFTPSERVER_PATH=/usr/libexec/openssh/sftp-server
I found the sftp-server path there.
Can you provide me a complete dropbear config file which I can use as per my need and other comment out?
And I am getting the following error when doing sftp from my local machine:
Code:
bash: /usr/libexec/sftp-server: No such file or directory
Connection closed
It means my local machine is looking for the sftp on /usr/libexec, but on the actual cloud VM, the sftp location is at /usr/libexec/openssh directory
can I just mv them to the required directory? will it work?
UPDATE:
I copied the sftp-server file from the /usr/libexec/openssh to /usr/libexec and now sftp is working somewhat, still testing if any required.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.