1819910 Members
2511 Online
109607 Solutions
New Discussion юеВ

ftp only

 
SOLVED
Go to solution
hangyu
Regular Advisor

ftp only

If I want to let the user to access the system via ftp , so that the user can't access the system via other way , like ssh , telnet , what can i do ? thx
4 REPLIES 4
g33k
Valued Contributor

Re: ftp only

well edit /etc/passwd na instaed of /bin/sh(ksh, bsah) give them /bin/nologin

it means after connection no shell is run, so they cannot workin with system using telnet or ssh
Steven E. Protter
Exalted Contributor

Re: ftp only

Shalom hangyu,

Set the shell to /usr/bin/false or /usr/bin/nologin.

Make sure these are defined in /etc/shells

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
Alexander Chuzhoy
Honored Contributor

Re: ftp only

Just to add that you can assign the shell upon user creation with:
useradd -s /sbin/nologin username

or change the shell for existing user with:
usermod -s /sbin/nologin username
George Liu_4
Trusted Contributor
Solution

Re: ftp only

The above mentioned is a good practice.