-
-
Forums
- Products
- Servers and Operating Systems
- Storage
- Software
- Services
- HPE GreenLake
- Company
- Events
- Webinars
- Partner Solutions and Certifications
- Local Language
- China - 简体中文
- Japan - 日本語
- Korea - 한국어
- Taiwan - 繁體中文
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Latin America
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Blog, Poland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Forums
-
Blogs
-
Information
-
English
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2016 11:43 PM
03-20-2016 11:43 PM
Hello Gurus ,
using sudo i want to copy a file , there's the command that i am using
/usr/local/bin/sudo /usr/bin/cp /CSEPF/b2b/INPUT/CSEPF/*.txt /home/wasadm/tst/CSEPF/
The cp command here is not working and gives error :
[FINDEV1]/home/wasadm -> /usr/local/bin/sudo /usr/bin/cp /CSEPF/b2b/INPUT/CSEPF/*.txt /home/wasadm/tst/CSEPF/
cp: cannot access /CSEPF/b2b/INPUT/CSEPF/*.txt: No such file or directory
her's the visudo file entry for it :
Cmnd_Alias CHNGPASSWD=/usr/bin/passwd
Cmnd_Alias ENBLUSER=/usr/lbin/modprpw
Cmnd_Alias ADMS=/sbin/set_parms date
Cmnd_Alias CSEPF=/usr/bin/cd /CSEPF/b2b/INPUT
Cmnd_Alias CHOWNCSE=/usr/bin/chown wasadm\:sftponly /home/wasadm/tst/*
Cmnd_Alias CPCSE=/usr/bin/cp -R /CSEPF/b2b/INPUT/CSEPF/*.txt /home/wasadm/tst/CSEPF/
Cmnd_Alias CPCSEC=/usr/bin/cp /CSEPF/b2b/INPUT/CSEPF/*.txt /home/wasadm/tst/CSEPF/ ##this one
Cmnd_Alias CSELL=/home/wasadm/tst/CSEPF/CSEll.sh
#Cmnd_Alias CHOWN=/usr/bin/chown wasadm:sftponly /home/wasadm/tst/
root ALL=NOPASSWD:ALL
%sysadmin ALL=NOPASSWD:ALL
%oper ALL=NOPASSWD:ALL
wasadm ALL=(root) NOPASSWD: ADMS,ENBLUSER,CHNGPASSWD,CSEPF,CHOWN,CPCSE,CHOWNCSE,CSELL,CPCSEC
wasadm ALL=NOPASSWD: /home/wasadm/cpme.sh
wasadm ALL=NOPASSWD: /home/wasadm/chownme.sh
Also , the file does exist in the location
[root@findev1:/home/wasadm/tst/CSEPF]#ls -ld /CSEPF/b2b/INPUT/CSEPF/*.txt
-rw-r--r-- 1 CSEPF sftponly 260 Dec 16 12:42 /CSEPF/b2b/INPUT/CSEPF/EMC_ESRS_Details.txt
[root@findev1:/home/wasadm/tst/CSEPF]#
can't figure out what i am missing , i did tried something like :
/usr/local/bin/sudo /sbin/sh -c '/usr/bin/cp /CSEPF/b2b/INPUT/CSEPF/*.txt /home/wasadm/tst/CSEPF/'
din't worked either ,
BR,
RT
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2016 12:43 AM - edited 03-21-2016 12:44 AM
03-21-2016 12:43 AM - edited 03-21-2016 12:44 AM
Solution>/usr/local/bin/sudo /usr/bin/cp /CSEPF/b2b/INPUT/CSEPF/*.txt /home/wasadm/tst/CSEPF/
If you don't have read permission with your original ID, you can't do filename expansion.
>/usr/local/bin/sudo /sbin/sh -c '/usr/bin/cp /CSEPF/b2b/INPUT/CSEPF/*.txt /home/wasadm/tst/CSEPF/'
Hmm, I would have thought that would work. Provided you can execute that too.
And provided it is a local filesystem.
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2022 Hewlett Packard Enterprise Development LP