Operating System - HP-UX
1833827 Members
2300 Online
110063 Solutions
New Discussion

Disabling/Enabling FTP/ Telnet for specific user.

 
Sathyaswarupa
Contributor

Disabling/Enabling FTP/ Telnet for specific user.

Hi experts,

How can one selectively enable or disable FTP or Telnet sessions for specific users?
2 REPLIES 2
RAC_1
Honored Contributor

Re: Disabling/Enabling FTP/ Telnet for specific user.

For disableing ftp for certain users, add their user names to /etc/ftpd/ftpusers file.
man ftpusers for details.

For diabling telnet, add following code to /etc/profile OR make use of TCP wrappers. (If you have hp-ux's ssh, then tcp wrappers comes in built with it.)

if [ $LOGNAME -eq "user1" -o $LOGNAME -eq "user2" ];then
echo "Telnet Not allowed for you"
exit 1
else
echo "Telnet OK
fi
There is no substitute to HARDWORK
yunardi
Frequent Advisor

Re: Disabling/Enabling FTP/ Telnet for specific user.

Hi Sathyas,

If tou want user can telnet only (can not ftp), add username on /etc/ftpd/ftpusers; if ftpusers file does not exist create this first.

If you eant user can ftp only (can not telnet),
1. check to see if you have the file /etc/shells
a) If you have, edited the file and add
/bin/false
b) If not do
ls /bin/*sh > /etc/shells then add the /bin/false line
2. create the user for example
# useradd -c "FTP Only User" -d /home/ftpfiles -m -s /bin/false -g staff "username"
or change existing user shells to /bin/false
Doing this by editing /etc/passwd or via command :
# usermod -s /bin/false "username"

Hope this help.

Thanks,