Delete sftp entry

Brief description of the problem

[I can not delete the sftp entry]

Detailed step by step instructions to reproduce the problem

[Recorded sftp with ftp rights and root owner]

Web-UI screenshot

[image ]

Error Traceback provided on the Web-UI

        Traceback (most recent call last):

File “/opt/rockstor/src/rockstor/rest_framework_custom/generic_view.py”, line 41, in _handle_exception
yield
File “/opt/rockstor/src/rockstor/storageadmin/views/sftp.py”, line 124, in delete
update_sftp_config(input_map)
File “/opt/rockstor/src/rockstor/system/ssh.py”, line 58, in update_sftp_config
return systemctl(‘sshd’, ‘restart’)
File “/opt/rockstor/src/rockstor/system/services.py”, line 64, in systemctl
return run_command([SYSTEMCTL_BIN, switch, service_name])
File “/opt/rockstor/src/rockstor/system/osi.py”, line 115, in run_command
raise CommandException(cmd, out, err, rc)
CommandException: Error running a command. cmd = /usr/bin/systemctl restart sshd. rc = 1. stdout = [’’]. stderr = [‘Job for sshd.service failed because the control process exited with error code. See “systemctl status sshd.service” and “journalctl -xe” for details.’, ‘’]

Welcome @oy_delovoy.
Two things, it looks like you are running on a fairly old version of Rockstor (3.9.1-0). It might be worthwhile running the update (since you are showing the arrow next to the version already).

Additionally, if you can provide the outputs for:

systemctl status sshd.service -l

and

journalctl -xe

right after you get this error message, when trying to remove the sftp share. This might give a little more insight on what is going wrong here.

2 Likes

Thank you, I will try to provide this as soon as possible. This is my first time creating ftp server and I don’t understand everything😅

sshd

jornal

@oy_delovoy

Mhm, looks like there’s no access to the config file. I am no expert in this field either … so somebody else might have to pick up after this …

If you do:

   ls -l /etc/ssh/

what are the file permissions you see? As an example on my sandbox this works and I get this output:
image

your root user should be really the only have read-write access to that file. In your case, it seems that user does not. If you made changes to that file with another user (or put it there from someplace else) that could have had an effect on the file permissions, and in turn make the daemon startup fail … and then also stop you from removing the sftp share …

I saw in the earlier screenshots that your ftp service was off: did you disable it, or wouldn’t it start up?

2 Likes

ls
ftp service doesn`t turn on

I was able to delete sftp entery, but I also can not enable sftp service
Traceback (most recent call last):
File “/opt/rockstor/src/rockstor/smart_manager/views/sftp_service.py”, line 52, in post
toggle_sftp_service()
File “/opt/rockstor/src/rockstor/system/ssh.py”, line 82, in toggle_sftp_service
return systemctl(‘sshd’, ‘restart’)
File “/opt/rockstor/src/rockstor/system/services.py”, line 64, in systemctl
return run_command([SYSTEMCTL_BIN, switch, service_name])
File “/opt/rockstor/src/rockstor/system/osi.py”, line 115, in run_command
if rc != 0:
CommandException: Error running a command. cmd = /usr/bin/systemctl restart sshd. rc = 1. stdout = [’’]. stderr = [‘Job for sshd.service failed because the control process exited with error code. See “systemctl status sshd.service” and “journalctl -xe” for details.’, ‘’]

sshd

@oy_delovoy, glad to hear you were at least able to remove the sftp entry. So, the remaining (bigger) issue is now the ability to start the sftp service itself.

I hope, @phillxnet or somebody else has a better idea, but, personally I would attempt to run the upgrade on the install (as indicated by the arrow next to your RockStor version in your first screenshot above:
image

The WiFi icon next to your Linux version also indicates that there are other package updates. The Rockstor update might address the sftp service issue by rectifying some of the settings. The better part is, that with the latest releases the backup of your Rockstor/Rockon settings has been vastly improved by @Flox, so that, in case the ultimate solution is to reinstall the RockStor app (without losing your shares/information) you can preserve your settings and reimport them.

2 Likes