Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Access Denied to backup but xp_cmdshell no Acess Denied Expand / Collapse
Author
Message
Posted Saturday, February 6, 2010 6:34 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, April 12, 2014 8:21 PM
Points: 17, Visits: 114
Hi,
I'm trying to backup to a network drive, but I keep getting the message below:
Cannot open backup device '\\Server\Projects\Exodus\Backup_Banco'. Operating system error 5(Access is denied.).

The weird thing is that if I use xp_cmdshell on the same folder, I can dir, copy files, etc... Why is that?
Below is by backup command code that I get the Access Denied:
BACKUP DATABASE Exodus
TO DISK = '\\Server\Projects\Exodus\Backup_Banco'
WITH
COPY_ONLY,
COMPRESSION,
NOFORMAT,
INIT

And both xp_cmdshell commands below works without a glitch:
exec xp_cmdshell 'dir \\Server\Projects\Exodus\Backup_Banco'
exec xp_cmdshell 'copy \\Server\Projects\Exodus\Backup_Banco\text.txt \\Server\Projects\Exodus\Backup_Banco\text4.txt'

Both SQL Server and SQL Agent are running on domain accounts, and I gave Modify rights on the \\Server\Projects\Exodus\Backup_Banco folder to the Domain Local Group that holds both accounts, as the copy commands shows.
Both commands use SQL Server's service account rights, so I should get the same treatment for both commands. But that's not what is happening.
Any ideas why?
Thanks
Post #861082
Posted Saturday, February 6, 2010 12:57 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, April 12, 2014 8:21 PM
Points: 17, Visits: 114
The file name was missing... stupid mistake... focusing on the complex things, and missed the simple things...
Post #861173
Posted Thursday, February 18, 2010 6:55 PM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Yesterday @ 6:10 AM
Points: 4,179, Visits: 4,260
I see that you posted this issue on another forum and the problem was resolved:

http://social.msdn.microsoft.com/Forums/en-IE/sqlsecurity/thread/ecec679e-1e50-4eff-beb1-283fb0fb8f54

Sorry but I missed your reply...

This Post should be closed.

Regards


For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Post #868714
Posted Thursday, February 18, 2010 7:05 PM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Yesterday @ 6:10 AM
Points: 4,179, Visits: 4,260
You should disable the xp_cmdshell unless absolutely needed:

http://www.sqlservercentral.com/Forums/Topic828767-386-1.aspx

http://download.microsoft.com/download/8/5/e/85eea4fa-b3bb-4426-97d0-7f7151b2011c/SQL2005SecBestPract.doc

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=123821

http://blogs.msdn.com/sqlsecurity/archive/2008/01/10/xp-cmdshell.aspx

Respectfully,
Welsh


For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Post #868719
Posted Friday, February 19, 2010 2:42 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, April 12, 2014 8:21 PM
Points: 17, Visits: 114
I did disable xp_cmdshell after my test.
And I posted back the solution I received from the other forum... Is this what you mean by closing the topic?
Post #868860
Posted Friday, February 19, 2010 5:08 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Yesterday @ 6:10 AM
Points: 4,179, Visits: 4,260
Yes, thank you.

For better, quicker answers on T-SQL questions, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537/

For better answers on performance questions, click on the following...
http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

Post #868954
Posted Friday, February 19, 2010 5:17 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, April 12, 2014 8:21 PM
Points: 17, Visits: 114
Ok. I was worried there for a second.
Tks for the tips!
Post #868963
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse