10-07-2022 01:28 PM
Hi Everyone,
I am need to transfer a file in DNAC and trying to used Winscp but unfortunately I am getting some error messages like Bash is recommended. I change the shell setting to Bash but still no luck. Can someone please kindly advice or give some direction how I can get this file in the DNAC with or without winscp.
I need to get file: CSCwb00526.sh.zip from:https://software.cisco.com/download and transfer to DNAC /data/tmp
See some pic below:
I think I getting SCP / Shell setting wrong. Any direction to set this up. Please help!
It seems to have been authenticated but yet it fails with an error message. See below:
Any advice will be appreciated. Thanks
Solved! Go to Solution.
10-08-2022 08:24 AM - edited 10-09-2022 01:01 AM
Ok that is interesting.
I have just installed the latest version of WinSCP (5.21.5), with default settings, and I can connect to my DNAC 2.3.3.4 server using SFTP and transfer files without any issues, however If I change the protocol to SCP, I receive the same error 'Error skipping startup message. Your shell is probably incompatible with the application (BASH is recommended)'.
For comparison, I performed the same test on a DNAC 2.2.2.8 server and I can connect and transfer files using both SFTP and SCP so I suspect that the SCP issue is related to the restricted shell feature that is enabled by default in the later versions of DNAC.
I disabled restricted shell on DNAC 2.3.3.4 and now SCP is working correctly. You can disable the restricted shell using the following command. Can you give this a go and see if it fixes the issue?
_shell -c 'sudo magctl ssh shell bash'
If this still fails to work, DNAC has an SFTP/SCP client that can be used to transfer files from a remote server to a local path. For example, you can use the following command from the DNAC CLI to transfer file 'test.txt' from remote SFTP server 192.168.1.1 to /data/tmp.
sftp user@192.168.1.1:test.txt /data/tmp
10-07-2022 02:15 PM
Hi @Macky05
I use WinSCP regularly to transfer files to/from DNAC. The fie protocol should be SFTP and not SCP. Can you set the protocol to SFTP and try again?
Hope that this helps
Will
10-07-2022 11:50 PM
I also tried with SFTP, and it failed.
With DNAC version Version 2.3.2.0, it seems there is no option to setup the stfp server.
However, I once troubleshooted with TAC and scp was used with some changes made in the Advance setting -> Shell of winSCP, just can't remember how the shell path was set. I have tried different paths but no luck. I am sure Cisco customized the defaults shell paths. Can anyone please let me know what this path could be or the advance setting?
10-08-2022 08:24 AM - edited 10-09-2022 01:01 AM
Ok that is interesting.
I have just installed the latest version of WinSCP (5.21.5), with default settings, and I can connect to my DNAC 2.3.3.4 server using SFTP and transfer files without any issues, however If I change the protocol to SCP, I receive the same error 'Error skipping startup message. Your shell is probably incompatible with the application (BASH is recommended)'.
For comparison, I performed the same test on a DNAC 2.2.2.8 server and I can connect and transfer files using both SFTP and SCP so I suspect that the SCP issue is related to the restricted shell feature that is enabled by default in the later versions of DNAC.
I disabled restricted shell on DNAC 2.3.3.4 and now SCP is working correctly. You can disable the restricted shell using the following command. Can you give this a go and see if it fixes the issue?
_shell -c 'sudo magctl ssh shell bash'
If this still fails to work, DNAC has an SFTP/SCP client that can be used to transfer files from a remote server to a local path. For example, you can use the following command from the DNAC CLI to transfer file 'test.txt' from remote SFTP server 192.168.1.1 to /data/tmp.
sftp user@192.168.1.1:test.txt /data/tmp
10-18-2022 04:12 AM
Thanks very much.
Bypassing the restriction shell with the command:
_shell -c 'sudo magctl ssh shell bash'
I could get remote access with winSCP via SFTP or SCP.
The reference link you provided is also very handy:
Thanks a lot.
05-07-2024 09:39 AM
Hello
Is this solution applicable to ISE, I am trying to patch file to ISE repository, i have an WINSCP on my laptop. Pls advise
10-12-2022 06:34 AM
Are you using "maglev" as your username? I can't speak on WinSCP, but I'm able to connect to my Cisco DNA Cluster running 2.3.2.1 using SFTP with Filezilla.
For a protocol I'm using SFTP, port 2222 and username maglev. You need to use your maglev username/password since you're essentially accessing the CLI, not the administrator GUI username/password.
Other than that, my advanced, transfer settings, charset, etc are all default.
05-09-2024 07:37 AM
To note, the command "sudo magctl ssh shell bash" will not work on 2.3.5.x and above. The correct method is to use sftp in winscp with the username as maglev and port 2222, along with the shell profile set to default not /bin/bash. This will allow you access to the file system in the restricted shell.
As a side note, please save all files in the artifacts directory as this directory has the most space and will not cause service disruption of the partition gets full.
05-09-2024 09:06 AM
05-09-2024 09:33 AM
Hi,
1. You would use the SSH login password for the WinSCP or any file transfer program.
2. Cisco ISE's restricted shell runs differently than Cisco Catalyst Center's (formerly known as Cisco DNA Center). I don't believe Cisco ISE allows most Linux commands such as sudo. I'm not sure how it is supposed to work there. Magctl/maglev commands will not work on Cisco ISE.
3. As above, this post is for Cisco Catalyst Center, not for Cisco ISE. Cisco ISE has it's own requirements.
4. I don't see any image so I cannot confirm what is right or now.
05-09-2024 09:57 AM
05-09-2024 10:26 AM
I understand however, this isn't a thread for Cisco ISE, this is a thread for Cisco Catalyst Center (Cisco DNA Center) within the forum space for Cisco Catalyst Center.
For Cisco ISE questions, it would be better to ask in that forum which should be under Network Management:
https://community.cisco.com/t5/network-management/bd-p/5931-discussions-network-management
From my limited dealings with Cisco ISE though, I had to put the patch on a Linux server I was using for backups, then create a repository on Cisco ISE pointing to the backup server and the file. At that point I was able to patch/upgrade Cisco ISE.
05-10-2024 01:38 AM
05-10-2024 06:43 AM
I cannot say this enough, this forum is not for Cisco ISE, it is for Cisco Catalyst Center. Please use the forum under Network Management for questions related to Cisco ISE operations. That is going to be the best place for you to get support and have your question answered.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide