when FTP user will go to specific directory

Hi experts,

I have a user "bingo" in my sunsolaris 9.
# /etc/passwd
bingo:x:513:1::/export/home/bingo:/bin/bash

when anyone Telnet to this user it goes to his home directory /export/home/bingo

But now i want- when someone FTP to this user "bingo" it will NOT go to his home dir. Rather it will go another specif directory. suppose: "/home/ftpbingo/"

Where to implement this one? Should i write anything in /export/home/bingo/.profile

thanks.

//purple

In that case you should not assign any shell to the ftp users, modify the �bingo� to point to shell as /bin/false, alos same need to be entered into the /etc/shell . If the file do not existing then create one and add all the required shell into this file.

Hi Kumar,

can u pls clarify more.

If someone telnet bingo- he will go to bingo's home dir. i.e /export/home/bingo/

if sameguy ftp bingo- he will go to /home/ftpbingo

To do this which file i need to modify or what things need to be define?

1st change the shell of user to /bin/false you can do the same with below command

Then check if the /etc/shells file in etc folder if its exists then add a line as /bin/false and save the changes.

Try again with telnet, ideally it should not allow you to login as user bingo do not have any login shell assign

Hi Kumar,

Here is the requirement-
If someone Telnet bingo- he will go to bingo's home dir. i.e /export/home/bingo/

Note that i have made some script which started with "#!/usr/bin/bash"; So, I cannot change the shell of "bingo"

Now if someone FTP bingo then he will go to /home/ftpbingo

!!So, Telnet will work normally. Only exception is FTP.

As per my understanding the best option seems to be duplicating the UID with two different names one as bingo and other could be ftpbingo where in case one you assign the logging shell however in second case you can assign no shell.

I am sure other experts can through some light on the solution