Results 1 to 8 of 8
Hi, I'm having problem copying a file
pix7@debian:~/Desktop/Downloads/ddclient-3.7.3$ ls -l
total 212
-rw-r--r-- 1 pix7 pix7 11173 2007-07-31 04:04 Changelog
-rw-r--r-- 1 pix7 pix7 2684 2007-08-07 14:36 ChangeLog
-rw-r--r-- 1 ...
- 03-07-2008 #1
cp: cannot create regular file `/usr/sbin/ddclient': Permission denied
Hi, I'm having problem copying a file

How do I copy it using comand line?pix7@debian:~/Desktop/Downloads/ddclient-3.7.3$ ls -l
total 212
-rw-r--r-- 1 pix7 pix7 11173 2007-07-31 04:04 Changelog
-rw-r--r-- 1 pix7 pix7 2684 2007-08-07 14:36 ChangeLog
-rw-r--r-- 1 pix7 pix7 18007 2006-06-15 03:51 COPYING
-rw-r--r-- 1 pix7 pix7 869 2006-06-15 03:51 COPYRIGHT
-rwxr-xr-x 1 pix7 pix7 109903 2007-08-07 14:35 ddclient
-rw-r--r-- 1 pix7 pix7 6403 2007-07-31 15:05 README
-rw-r--r-- 1 pix7 pix7 1151 2006-06-15 03:51 README.cisco
-rw-r--r-- 1 pix7 pix7 319 2007-07-31 15:06 README.ssl
-rw-r--r-- 1 pix7 pix7 876 2006-06-15 03:51 sample-etc_cron.d_ddclient
-rw-r--r-- 1 pix7 pix7 5180 2006-06-15 03:51 sample-etc_ddclient.conf
-rw-r--r-- 1 pix7 pix7 634 2006-06-15 03:51 sample-etc_dhclient-exit-hooks
-rw-r--r-- 1 pix7 pix7 668 2007-08-08 03:12 sample-etc_dhcpc_dhcpcd-eth0.exe
-rw-r--r-- 1 pix7 pix7 1355 2007-07-07 20:37 sample-etc_ppp_ip-up.local
-rwxr-xr-x 1 pix7 pix7 1850 2006-06-15 03:51 sample-etc_rc.d_init.d_ddclient
-rwxr-xr-x 1 pix7 pix7 1692 2006-06-15 03:51 sample-etc_rc.d_init.d_ddclient.lsb
-rwxr-xr-x 1 pix7 pix7 801 2006-06-15 03:51 sample-etc_rc.d_init.d_ddclient.redhat
-rwxr-xr-x 1 pix7 pix7 856 2006-09-30 21:14 sample-etc_rc.d_init.d_ddclient.ubuntu
-rw-r--r-- 1 pix7 pix7 362 2007-07-30 15:10 TODO
pix7@debian:~/Desktop/Downloads/ddclient-3.7.3$ cp ddclient /usr/sbin/
cp: cannot create regular file `/usr/sbin/ddclient': Permission denied
pix7@debian:~/Desktop/Downloads/ddclient-3.7.3$
- 03-07-2008 #2
you could login as root
#su -
and then copy it
Or better yet, learn to use sudo
#apt-get install sudo
#man sudo
- 03-07-2008 #3
The error message says it all really,
Most users cannot write outside their own home directory by default (except in places like /var/tmp, /tmp and other temporary directories). This means that you need to be root in order to copy that file to /usr/sbin. Also note that if you copy that file to /usr/sbin only root will be able to use it without entering the full path of the command because */sbin directories are not usually in the path of normal users.cp: cannot create regular file `/usr/sbin/ddclient': Permission denied
- 03-07-2008 #4
su saved my day!
pix7@debian:~/Desktop/Downloads/ddclient-3.7.3$ su
Password:
debian:/home/pix7/Desktop/Downloads/ddclient-3.7.3# cp ddclient /usr/sbin
debian:/home/pix7/Desktop/Downloads/ddclient-3.7.3#
thanks guys!
I love this forum!
How do I mark this thread solved?
- 12-17-2010 #5Just Joined!
- Join Date
- Dec 2010
- Posts
- 2
I "su'ed" into root, but I still cannot copy files (i.e., I get the same error message as a regular user). Perhaps root is not as powerful on my machine. Please advise ASAP as I have a mount point on one machine which points to a directory on another machine, and I am trying to copy a file (me_accts.tar) from the source machine to the destination machine on the mounted directory. I have a deadline for configuring this application. Attached screenshot shows the activity in question. Thanks.
- 12-17-2010 #6Just Joined!
- Join Date
- Dec 2010
- Posts
- 2
One thing I did was (while su'ed as root) su as the owner of the file, then perform the copy (cp command)...that seemed to work.
But the point is that as "root", I should be able to copy files from anywhere to anywhere, no matter who the owner is. Why do I need to go that extra route?
- 12-19-2010 #7
You need to change to root using "su -" and not simply "su". That way you will get all of roots environment and settings.
- 12-20-2010 #8Just Joined!
- Join Date
- Dec 2010
- Posts
- 9
Add the user to /etc/sudoers
You can do that by saving the following line at the end of the sudoers file.
pix7 ALL=NOPASSWD: ALL
Once you are done, use sudo before any command which requires root permissions.
eg: sudo cp ddclient /usr/sbin/


Reply With Quote

