Operating System - HP-UX
1855598 Members
2271 Online
104112 Solutions
New Discussion

sftp files-------hp-ux 11i v2

 
SOLVED
Go to solution
sheevm
Regular Advisor

sftp files-------hp-ux 11i v2

Hi,

one of our application is sending batch files via sftp to another server. The receiving server is not able to access those files, it is created using the source server umask of 640. Is there a way to change the file permission to 666 before doing the SFTP PUT TO the other server? Is there any sftp configuration file one can modify? If so where is it located?

Thanks for your help.
RAJIM
be good and do good
5 REPLIES 5
Steven E. Protter
Exalted Contributor
Solution

Re: sftp files-------hp-ux 11i v2

Shalom,

/etc/ssh/ssh_config

or

/etc/ssh/sshd_config

The files are both well documented and you will need to restart sshd in order to have the changes take effect.

This needs to be done on the receiving server.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Don Wilt
Advisor

Re: sftp files-------hp-ux 11i v2

On the receiving side update /opt/ssh/etc/sshd_config and put in the following:
# sftp-server umask control
#SftpUmask
SftpUmask 022
This will change the umask for sftp, as stated you will need to recycle ssh.
Kofi ARTHIABAH
Honored Contributor

Re: sftp files-------hp-ux 11i v2

Have you considered using the -P option for the put? do a man sftp (search for the put keyword)for more details.

put -P local-path remote-path

Hope this helps

Kofi
nothing wrong with me that a few lines of code cannot fix!
KapilRaj
Honored Contributor

Re: sftp files-------hp-ux 11i v2

scp -p ?? I don't know if there is an advantage of using sftp over scp

Kaps
Nothing is impossible
Bill Hassell
Honored Contributor

Re: sftp files-------hp-ux 11i v2

666 permissions? Changing the permission to anyone to trash ytour files at any time is definitely not a good idea. Unfortunately, many beginner books for Unix give examples with 666 and 777 which is the worst possible setting!!

With permissions, you ask the questions:

1. Are these files executable scripts? If no, then do *not* set the execute bit anywhere.

2. Are these files supposed to changed by any user on the system. If no, then do not set the write bit for the world.

3. Are these files supposed to be read by anyone on the system? If no, do not set the read bit for4 the world.

I think what you want is 644, not 666. Every file that has 666 permissions cannot be trusted - it will be eventually trashed either accidentally or on purpose.


Bill Hassell, sysadmin