1833858 Members
3774 Online
110063 Solutions
New Discussion

Problem with shell

 
SOLVED
Go to solution
R.O.
Esteemed Contributor

Problem with shell

Hi all,

I need to avoid that when an user logs out from an application come into the operating system, and when the users log into the sistem, execute directly an application. I did it by put in /etc/passwd, instead of the shell a program which executes a shell with the command that launches the application:

In /etc/passwd: user1:..:..:..:..:/home/user1/launcher

Content of launcher:
/usr/bin/sh -c application

This works fine, but into the application there is an ftp, and it does not work when I execute the application of this manner. I don´t know how is this application. Does somebody have any idea of where could be the problem?

Best regards,

R.
"When you look into an abyss, the abyss also looks into you"
5 REPLIES 5
Mark Greene_1
Honored Contributor

Re: Problem with shell

Create a new login ID that is ftp only. Set the shell to /usr/bin/false and add the old login ID to /etc/ftpd/ftpusers.

mark
the future will be a lot like now, only later
Dave La Mar
Honored Contributor

Re: Problem with shell

R.O.
Attached are documents outlining creating a restricted ftp user. We used the attached to create a number of ftp only accounts.

Best of luck.

Regards,
dl
"I'm not dumb. I just have a command of thoroughly useless information."
Tomek Gryszkiewicz
Trusted Contributor

Re: Problem with shell

Try to add /home/user1/launcher to /etc/shells, then you can ftp to this machine.

-Tomek
Graham Cameron_1
Honored Contributor
Solution

Re: Problem with shell

Or just use a standard account but make it captive, so it launches straight into your app.

eg, in .profile, put something like:

trap "" 1 2 3
exec /path/to/application

The trap statment stops them ^C ing out, and the exec launches their app such that it replaces the shell, so that when they quit the app, they log right out.

-- Graham
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.
R.O.
Esteemed Contributor

Re: Problem with shell

Hi,

Thank you very much, Graham. My boss suggest me the same solution as the yours and it is exactly what I wanted. So, 10 point for everyone.
Thanks too to the other people.

R.O.
"When you look into an abyss, the abyss also looks into you"