LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-08-2005, 06:55 AM   #16
bharaniks
Member
 
Registered: May 2005
Distribution: Red Hat Linux
Posts: 36

Original Poster
Rep: Reputation: 15

Hey Jul3z,

That's it, finally after a great struggle found the right way.

After following you tip i'm able to reach my requirment, but in the shell script (YourScriptHere.sh)
i'm calling a expect script. But while trying to do that the session quits. Do i want to add any
entries to run the expect script ?

Thanks a lot for the solution, waiting for your next suggestion.
 
Old 07-11-2005, 02:18 AM   #17
primo
Member
 
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
I'm still not sure about what you're trying to do, but I will tell you some things anyway...

Catch the signals that may interrupt/stop the script. Run "help trap".

You may test it this way:
trap "echo Hey!" INT
^C
kill -INT $$

The signals you need to be aware of are:
SIGHUP - Hangup
SIGINT - ^C
SIGQUIT - ^\
and possibly:
SIGTSTP - ^Z

To test your script, see your key combinations with "stty -a".

The bash manpage states that:
The shell exits by default upon receipt of a SIGHUP. Before exiting, an interactive shell resends the SIGHUP to all jobs, running or stopped.

So you may use this signal to kill off any processes left running by the user:
trap "pkill -9 -U username" HUP

If you want to restrict shell access, then be warned that some programs may spawn a shell...
If you care about security, don't use telnet (specially if this account will use a shell). Use ssh instead.
 
Old 07-12-2005, 12:05 AM   #18
bharaniks
Member
 
Registered: May 2005
Distribution: Red Hat Linux
Posts: 36

Original Poster
Rep: Reputation: 15
Hi jul3z,

How are you ?

With your suggestion my process goes on very well, But a small query that
If i'm entering the script in file "/etc/passwd" it reaches my requirement but
at the same time the user is unable to login through FTP.

Is there any way to use the same user for both Telnet and FTP.

Awaiting your reply.
 
Old 07-12-2005, 01:19 AM   #19
primo
Member
 
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
Quote:
Originally posted by bharaniks
Is there any way to use the same user for both Telnet and FTP.

Yes, because they read the same files (/etc/passwd, shadow, etc.). The problem now is that the ftp daemon reads /etc/shells and refuses connection if the user's shell isn't a valid shell (ie, isn't listed in /etc/shells). Comment the line in /etc/pam.d/ftpd to be something like this:
Code:
#auth       required    pam_shells.so
The '#' above is a comment...


Note that ssh can replace telnet and ftp and it's more secure
(I couldn't resist...)
 
Old 07-12-2005, 04:18 AM   #20
bharaniks
Member
 
Registered: May 2005
Distribution: Red Hat Linux
Posts: 36

Original Poster
Rep: Reputation: 15
Hi Primo,

I have tried your option but still i'm unable to use the FTP for the user
abd able to login using the same user on Telnet port.

FYI : There is no file called "/etc/pam.d/ftpd" but instead of that file "ftp" in the path.

I'm using VSFTP on my Linux box.

Is there any other option ?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux Distro that will securely clean hard drive? alime Linux - Distributions 7 02-01-2012 06:43 PM
LINUX BOX Logging out pradi_net Linux - Software 1 10-26-2004 01:13 AM
Best Logging software for Traffic through Linux RH 7.3 Box Modem dialup connection sombra_tommy Linux - Software 1 01-05-2004 12:55 PM
Logging in slow to RH 9.0 box tarballed Linux - Newbie 1 07-31-2003 12:03 PM
Programmatically logging on to a Unix Box? concoran Programming 6 07-09-2002 06:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 07:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration