![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| file transfer using scp.. | KiranKumarKarre | Shell Programming and Scripting | 5 | 05-18-2009 05:47 AM |
| File transfer | Shahul | Shell Programming and Scripting | 2 | 11-28-2008 02:20 PM |
| XFB file transfer | sais | IP Networking | 0 | 11-05-2008 03:02 AM |
| Transfer the file | manas_ranjan | UNIX for Dummies Questions & Answers | 2 | 07-27-2007 09:33 AM |
| transfer of specific file content to another file | mem101 | Shell Programming and Scripting | 1 | 10-18-2005 02:01 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
File transfer using SCP
I have a shell script which uses SCP command to transfer the files from one server to another server. The files are getting transferred successfully, but the problem is the files transferred to the destination server didnot have the permissions as that of the files on the source server.
Command used: scp file_name username@servername:/dest_directory/ Files permissions on Source server : -rw-r--r-- Files permissions on Destn server : -rw------- I cannot use "scp -p" or any other variations since there are 40 shell scripts already running daily in the production server(source server) Please help me to resolve the issue. Last edited by kumarm; 06-30-2009 at 02:19 PM.. |
|
||||
|
I cannot use "scp -p" or any other variations since there are 40 shell scripts already running daily in the production server(source server),Since I need to change all of the scripts
Earlier scp without -p option worked fine. We are facing this problem after the OS upgrade on destination server. |
|
||||
|
You mean an sshd upgrade as well. That is your problem.
I am assuming something that conforms to openSSH. The destination node (server) sets the permissions. SFTP_UMASK is an environment variable that you can add to the sshd process on the server. It does what you think - changes permissions for sftp operations. ssh_config may have a SftpUmask setting as well. I DO NOT KNOW if this affects scp. 1. try changing ssh_config to see if it impacts what you need. Every sshd node needs this change. 2. switch to sftp, SFTP_UMASK ....I know it is a code change. 3. use scp -p ... this is a code change too. Without getting help from your OS provider, 1, 2, 3 are pretty much your choices. The only one I know above that works is scp -p. Maybe someone else knows a workaround. Your choice. |
|
||||
|
in your profile, you could set an alias for scp to be the scp -p command. This would work as long as you didn't do an absolute patch for scp.
|
| Sponsored Links | ||
|
|