LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-28-2006, 08:40 AM   #1
juanb
Member
 
Registered: May 2002
Posts: 401

Rep: Reputation: 30
scp problem


Hi,

I trying to copy a file named music1.tar from two linux boxs I get a file permission error although I am doing this as root and the file has 777 permission this is the error I get:

root@juanbox juanb]# scp /home/juanb/music1.tar juanb@192.168.1.10:/home/juanb
juanb@192.168.1.10's password:
scp: /home/juanb/music1.tar: Permission denied


any ideas?

Thanks,

Juan
 
Old 01-28-2006, 09:41 AM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 64
Structure looks fine as long as the computer you are on with the file music1.tar is to be copied to the remote machine at 192.168.1.10. Is this what you are doing?

Brian1
 
Old 01-28-2006, 09:51 AM   #3
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
Quote:
juanb@192.168.1.10's password:
You're showing that as the prompt you get rather than text you're typing I hope? Have you verified the password you're using works?

Try doing ssh to juanb@192.168.1.10 using same password to make sure you can login there. If you can't then you need to check the following:
1) Password for juanb on 192.168.1.10. This can NOT be blank because ssh/scp will reject it as an insecure connection.
2) Make sure juanb's home directory (~juanb) on 192.168.1.10) is writable ONLY by user juanb (ls -ld ~juanb and look at left most column for permissions.)
3) Make sure .ssh UNDER juanb's home directory on 192.168.1.10 is readable and writable ONLY by juanb (ls -ld ~juanb/.ssh).

ssh/scp will NOT work if it believe the environment is insecure for any reason and the above are items I've seen in the past that showed it as insecure.

Finally check to make sure the file does not ALREADY exist on 192.168.1.10. It may simply be it does but juanb doesn't have permission to overwrite it there.
 
Old 01-28-2006, 12:19 PM   #4
juanb
Member
 
Registered: May 2002
Posts: 401

Original Poster
Rep: Reputation: 30
I changed the permission and now It seems better but I dont have ssh directory of file in my home directory in 192.168.1.10

I changed the permissions with this command:

chmod 744 -R /home/juanb

this is the error I get now:

juanb@attackbox juanb]$ scp /home/juanb/music1.tar juanb@192.168.1.10:/home/juanb
Could not create directory '/home/juanb/.ssh'.
The authenticity of host '192.168.1.10 (192.168.1.10)' can't be established.
RSA key fingerprint is 99:ec:0c:ee:a2:8d:6a:86:de:3d:76:f8:9f:00:7d:0b.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Failed to add the host to the list of known hosts (/home/juanb/.ssh/known_hosts).
juanb@192.168.1.10's password:
Could not chdir to home directory /home/juanb: Permission denied
bash: /home/juanb/.bashrc: Permission denied
/home/juanb/music1.tar: Permission denied
 
Old 01-28-2006, 12:21 PM   #5
juanb
Member
 
Registered: May 2002
Posts: 401

Original Poster
Rep: Reputation: 30
ha and I tried to ssh to thos machine with the password of juanb and the login was fine.

Thanks !
 
Old 01-28-2006, 12:42 PM   #6
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 64
If using keys then the chmod command changed values of .ssh and .ssh/authorized_keys.
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys

See if that corrects some of it.
Brian1
 
Old 01-28-2006, 01:15 PM   #7
juanb
Member
 
Registered: May 2002
Posts: 401

Original Poster
Rep: Reputation: 30
I dont have any .ssh folder or file in this hole directory.
 
Old 01-28-2006, 01:52 PM   #8
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
The message:

Quote:
Could not create directory '/home/juanb/.ssh'.
means it was trying to create /home/juanb/.ssh for you - presumably so it could add your source host to the known hosts file.

Note that files with "." at the beginning are "hidden" in Unix/Linux. Doing ls -l won't show them - you have to do ls -la to show such files. Since its a directory you would do ls -lad .ssh to see the directory itself rather than its contents. Doing ls -la .ssh shows you what is IN .ssh instead.

If you don't have a .ssh subdirectory create one there then make sure as mentioned before that it is only readable/writable by user juanb.

Odd though - if ssh worked I'd think scp would work unless as mentioned before the file you're transferring already exists there.

Also you mentioned you did chmod 744 on /home/juanb. Did you verify it is owned by user juanb rather than root or some other user?
 
Old 01-28-2006, 02:32 PM   #9
juanb
Member
 
Registered: May 2002
Posts: 401

Original Poster
Rep: Reputation: 30
okey progress :-)

now when I issue the command I get this:
scp /home/juanb/music1.tar juanb@192.168.1.10:/home/juanb
juanb@192.168.1.10's password:
/home/juanb/music1.tar: No such file or directory
the file exist in the source server here are it is:
[root@juanbox juanb]# ls -la |grep music1.tar
-rwxrwxrwx 1 juanb root 3623997440 Jan 27 14:05 music1.tar*

I also tried to transfer the other music2.tar file which doesnt have the * in the name of the file but still the same error...
 
Old 01-28-2006, 03:03 PM   #10
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 64
First remove the star '*' on the name. Keep names simple.
Now where is the music1.tar file? the machine starting the scp command or at 192.168.1.10
Is the file right in /home/juanb/music1.tar? ls can sometimes provide odd info. Just type ' ls ' to see.

Just to make sure the ownership is correct goto /home at each machine and issue the commands. Probalby will require root to run.
/sbin/chown -R juanb juanb
/sbin/chgrp -R juanb juanb
Reason is from the above post the file music1 .tar* belongs to user juanb but belongs in the root group. Should look like.
rwxrwxrwx 1 juanb juanb 3623997440 Jan 27 14:05 music1.tar*
or possible
rwxrwxrwx 1 juanb users 3623997440 Jan 27 14:05 music1.tar*
if using a common group for users. All depends on how the system is setup.

To check look in your /etc/group and see if juanb exist. Then you check to see the value beside it and compare it to the one /etc/passwd.

Brian1

Last edited by Brian1; 01-28-2006 at 03:11 PM.
 
Old 01-28-2006, 03:38 PM   #11
juanb
Member
 
Registered: May 2002
Posts: 401

Original Poster
Rep: Reputation: 30
IT IS WORKING THANKS VERY MUCH !

now another short question... the destination server in which I am sending the file to, this server is open to the world in ftp ssh and web does the scp causes a hole in this server? which port this scp server is open now? is it possible and secure for me to send files let say when Im in the office to this server throw the internet?

thanks very very much !
 
Old 01-28-2006, 04:21 PM   #12
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 64
scp uses the service of ssh which is tcp port 22. If you are satisfied with your level of ssh security then scp is of no issue.

Great to see you have it going.
Brian1
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
scp does not work and gives the following error message: scp: FATAL: Executing ssh1 i akay Linux - Networking 16 09-28-2008 11:41 PM
scp problem mbegovic Linux - Networking 2 12-11-2005 04:17 PM
SCP problem Lotharster Linux - Networking 6 12-02-2005 03:40 AM
scp problem! alaios Linux - Security 5 05-08-2004 01:06 PM
scp problem eduac Linux - Security 3 08-11-2003 10:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration