LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 02-01-2007, 11:06 AM   #1
bujecas
Member
 
Registered: Oct 2004
Location: Portugal
Distribution: Debian, Slackware
Posts: 78

Rep: Reputation: 15
Creating a link from "." to other directory on SCP


Hello,

I'm using scp to copy files to a server. I have a user directory in the server and a subdirectory. This is the directories:

Server:
/home/user
/home/user/subdir

My problem is: Using the command "scp files user@server:.", how can I link the "." directory to the subdir to copy the files to /home/user/subdir instead of the /home/user?

Thanks.
 
Old 02-01-2007, 11:22 AM   #2
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,393
Blog Entries: 1

Rep: Reputation: 64
Code:
scp files user@server:./subdir/
As the default current directory "." is /home/user, ./subdir/ is the same as /home/user/subdir/.

PS: I am not sure if the last slash in subdir/ is really necessary. But it not hurts.

Last edited by marozsas; 02-01-2007 at 11:23 AM.
 
Old 02-01-2007, 11:26 AM   #3
bujecas
Member
 
Registered: Oct 2004
Location: Portugal
Distribution: Debian, Slackware
Posts: 78

Original Poster
Rep: Reputation: 15
You didn't understand the question, my problem is that I can't change the format of the command "scp files user@server:.".
 
Old 02-01-2007, 11:41 AM   #4
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,393
Blog Entries: 1

Rep: Reputation: 64
oh, I see....
Can you change your home dir in the remote system to /home/user/subdir ?
Or create a new bogus user with the home dir set to /home/user/subdir ?

What are you try to accomplish ?
May be you can use other transfer programs over ssh, like rsync.

Would be nice if you develop your question a little more....
 
Old 02-01-2007, 11:54 AM   #5
bujecas
Member
 
Registered: Oct 2004
Location: Portugal
Distribution: Debian, Slackware
Posts: 78

Original Poster
Rep: Reputation: 15
Well,

The "user" on that server was copying files with normal scp to its homedir. Now I want to convert the user to copy the files using scponly. Doing the chroot environment in the server the homedir will be:

/home/user/ -> owned by root
/home/user/"chroot system files and directories" -> owned by root
/home/user/subdir -> owned by user

With this scenario, the user only have permission to copy the files to subdir, and I want to be that way. Now I don't want to tell to the user client about the server changes, this should be transparent, so the command "scp files user@server:." shouldn't change. Instead the server should be capable of redirect the incoming files to the subdir.
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"creating symbolic link" "operation not permitted" wheni Linux - Newbie 3 05-08-2011 02:36 AM
Creating a "shortcut" to a directory? technician Linux - Newbie 3 09-29-2005 02:24 PM
"stalled" problem in " scp" command gentleshark Linux - Software 1 08-30-2005 03:08 AM
"stalled" problem in " scp" command gentleshark Linux - Networking 1 08-29-2005 01:41 PM
HELP w/ creating link in "Applications" xiojqwnko Linux - Newbie 6 12-10-2003 11:17 AM


All times are GMT -5. The time now is 09:42 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration