chmod remote server file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers chmod remote server file
# 1  
Old 02-23-2010
chmod remote server file

I would like to chmod the file which I am pulling from remote server onto my server.
I am using the following script:

Code:
sftp <server detail>
get abc xyz
chmod 666 xyz
bye

Though I could fetch the file successfully but I am not able to change the permission of xyz file on my server. Pls help....

Last edited by Scott; 02-23-2010 at 07:10 AM.. Reason: Please use code tags
# 2  
Old 02-23-2010
I guess you are right , have u test the umask value ? , Please let me know your umask value.
# 3  
Old 02-23-2010
I guess it is 022...From where I can confirm it?
# 4  
Old 02-23-2010
If you are not sure about the umask value of your system means just execute the umask command. It will give the exact value. and confirm it whether it is 022
# 5  
Old 02-23-2010
thanks...yeah it is 0022

---------- Post updated at 05:06 AM ---------- Previous update was at 04:31 AM ----------

I would like to chmod the file which I am pulling from remote server onto my server.
I am using the following script:

Code:
sftp <server detail>
get abc xyz
chmod 666 xyz
bye

Though I could fetch the file successfully but I am not able to change the permission of xyz file on my server. Pls help....

umask value is 0022

Last edited by Scott; 02-23-2010 at 08:55 AM.. Reason: Code tags
# 6  
Old 02-23-2010
When in the ftp session the chmod applies to the remote server. I think you need to issue the chmod from unix shell after the ftp session finishes.

Code:
sftp <server detail>
get abc xyz
bye

chmod 666 xyz

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script connect to remote server, not find files and exit only from remote server, but not from scrip

I have a script, which connecting to remote server and first checks, if the files are there by timestamp. If not I want the script exit without error. Below is a code TARFILE=${NAME}.tar TARGZFILE=${NAME}.tar.gz ssh ${DESTSERVNAME} 'cd /export/home/iciprod/download/let/monthly;... (3 Replies)
Discussion started by: digioleg54
3 Replies

2. Shell Programming and Scripting

Sudo connect to a remote server and execute scripts in remote server

Hello Every one!! I am trying to write a shell script which will connect to a remote server and execute scripts which are at a certain path in the remote server. Before this I am using a sudo command to change the user. The place where I am stuck is, I am able to connect to the... (6 Replies)
Discussion started by: masubram
6 Replies

3. Shell Programming and Scripting

How to Append the output of a script running in remote server to a file in local server?

Hi guys, So i am in server1 and i have to login to server 2, 3,4 and run some script there(logging script) and output its result. What i am doing is running the script in server2 and outputting it to a file in server 2 and then Scp'ing the file to server1. Similarly i am doing this for other... (5 Replies)
Discussion started by: srkmish
5 Replies

4. Shell Programming and Scripting

How to create a file in remote server from local server?

hi, can anyone tell me how can i store the names of a file that are in remote server to a file and then get the file that contains the name in local server? there is a remote server where 5 files are present , say a.txt b.txt c.txt d.txt e.txt i want to write a script in my local... (4 Replies)
Discussion started by: Little
4 Replies

5. UNIX for Dummies Questions & Answers

chmod on a remote server -solved

hello, I am trying to copy a file over to a set of aix servers and then set the file permissions, owner, group etc and all of this logged in as sudo. I was able to copy the file over using rcp - i know its not secure or not best way to copy - but unable to execute chmod on the remote server as... (0 Replies)
Discussion started by: in5ane
0 Replies

6. Shell Programming and Scripting

preserving the timestamp of a file when copied from remote server to local server using ftp

Hi, I need to copy few files from remote server to local server. I write a shell script to connect to the remote server using ftp and go to that path. Now i need to copy those files in the remote directory to my local server with the timestamp of all those files shouldnt be changed. ... (5 Replies)
Discussion started by: arunkumarmc
5 Replies

7. UNIX for Dummies Questions & Answers

chmod of remote file

I would like to chmod the file which I am pulling from remote server onto my server. I am using the following script: sftp <server detail> get abc xyz chmod 666 xyz bye Though I could fetch the file successfully but I am not able to change the permission of xyz file on my server. umask... (1 Reply)
Discussion started by: kdtrica
1 Replies

8. Shell Programming and Scripting

Transfer file from local unix server to remote server

want to remove this thread. thanks (2 Replies)
Discussion started by: indira
2 Replies

9. HP-UX

Transfer file from local unix server to remote server

want to remove the thread thanks (2 Replies)
Discussion started by: indira
2 Replies

10. UNIX for Advanced & Expert Users

chmod (permissions) * not working on remote server

Hi gurus ! I am developing a FTP script which will copy all the files from one server to another server and then I need to use CHMOD 755 * to set permissions of all the files just copied to the remote server. mput * chmod 755 * CHMOD gives me an error CHMOD works fine If I specify... (3 Replies)
Discussion started by: sdlayeeq
3 Replies
Login or Register to Ask a Question