1844101 Members
3192 Online
110227 Solutions
New Discussion

access to sftp or scp

 
RogerVI
Regular Advisor

access to sftp or scp

Hi,everybody
I'm using ssh protocol (the sshd daemon is runnning in my Unix server). In my Unix system, I have restricted the access to server through /etc/hosts.allow file. I give access to login to few users by adding lines in this file.

For example:

sshd:10.100.9.4


A new application needs copy files from Windows to Unix using scp or sftp. But due that most machines have no access to server, the copy fails.
Is it possible restrict access to login, but allow scp or ftp ?. It means I want that any machine can run scp or ftp, but only a few users be able to login.

Thanks in advance

Roger
Roger
4 REPLIES 4
David de Beer
Valued Contributor

Re: access to sftp or scp

Hm..

You can either Allow everyone and deny specific accounts (I think this is what you want?), or you'll have to deny everybody and only allow specific accounts. You can do this for a group of people, or per user.

Do a man on sshd_config, these are the options that you want to change:

AllowUsers root david nanette peter
AllowGroups staff admin
DenyUsers trevor etselle melissa jack
Denygroups gis it

OldSchool
Honored Contributor

Re: access to sftp or scp

Something similar to this might work:

allow logins from serverX.

for users that sftp only, set shell in passwd file "false" or /usr/bin/false(?).

same setup as traditionally used to allow ftp / telnet, only the tools are different. I've not tried this before, so use at your own risk
Heironimus
Honored Contributor

Re: access to sftp or scp

sftp and scp won't work with /usr/bin/false as a shell, but you can set the user's shell to the sftp-server binary for sftp-only accounts or use rssh.
Suraj K Sankari
Honored Contributor

Re: access to sftp or scp

Hi,

Please find the attached file and try to setting the sftp with chroot.

Suraj