Score:0

SCP on Ubuntu OpenSSH Server for Cisco backups

mp flag

I am having a bit of an issue and I believe I need some help. We have an On-prem SFTP server which will be deprecated soon, so in the mean time I need to set up another SFTP option in AWS running on EC2. I have looked at AWS Transfer Family, but the older cipers and Keys are not accepted on AWS Transfer Family.

Anyways I have the need for two users to use this SFTP server for automated backups. One is an accesscontrol system and the other one is Cisco Switches which use the SCP command from the Cisco CLI to backup.

I have a group on Ubuntu 20.04 called 'sftp' which has both users and from WinSCP it appears to work without issue. It will log the user into their '/home/%u' directory which they are able to write to.

Match Group sftp
ChrootDirectory /home
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp -d /%u

Now when I attempt to run the SCP command from cisco I get the following error:

%his service allows sftp connections only.
%Error writing scp://*****@10.2.100.34//backups/b1sw007.cfg.test.20230228 (Permission denied)

I have done some reading into this and I think the ForceCommand is setting it to 'internal-sftp' which is causing this issue. The question is how do I remove that ForceCommand without breaking it for the other user. I 'think' if I remove the ForceCommand it will allow Cisco to use SCP?

Please let me know if you have any questions.

Thanks

in flag
Why are you trying to use sftp with scp? those are completely different protocols. Use an sftp capable client.
brianbelden avatar
mp flag
Cisco Switches do not support SFTP. They only Support FTP, TFTP, SCP, etc.
vidarlo avatar
ar flag
Then the answer is that they can't use sftp; you have to scp. Hence, remove the ForceCommand.
brianbelden avatar
mp flag
If you remove the ForceCommand it can use SCP? Does the ChrootDirectory still work with SCP?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.