Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 12th January 2007, 13:41
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 873
Thanks: 1
Thanked 14 Times in 13 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
Default ISPC 2.2.9: Invalid user shell on Ubuntu/Debian

Just figured that regular users are created by ISPConfig with a default shell of /dev/null. Unfortunately, this is invalid on Debian based systems, as the shell has to be an executable program/script. The most easy way I believe is to change the shell to /bin/false.

Looking at ISPConfig 2.2.9, I think the only place to modify this is in
Code:
/root/ispconfig/scripts/lib/classes/ispconfig_system.lib.php
and change the in function deactivateuser (lines 115 - 125) the shell, so the script will now look like:
PHP Code:
function deactivateuser($user_username){
  
$passwort str_rot13($this->getpasswd($user_username));
  
$user_attr $this->get_user_attributes($user_username);
  
$uid $user_attr["uid"];
  
$gid $user_attr["gid"];
  
$username $user_attr["name"];
  
$homedir $user_attr["homedir"];
  
$shell "/bin/false";                  //  <======= Change this line
  
$this->deluser($user_username);
  
$this->adduser($user_username$uid$gid$username$homedir$shell$passwort);

I believe this will work for any Linux distribution.
Reply With Quote
  #2  
Old 12th January 2007, 14:51
jnsc jnsc is offline
rotaredoM
 
Join Date: Mar 2006
Location: Lausanne, Switzerland
Posts: 421
Thanks: 5
Thanked 24 Times in 24 Posts
Default

I think it's a good idea as /bin/false is also listed in /etc/shells, so there will be no problem with some ftp server who require a valid shell (listed in /etc/shells).
Reply With Quote
  #3  
Old 12th January 2007, 17:15
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 873
Thanks: 1
Thanked 14 Times in 13 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
Default

Yup, that's why I had to change it. FTP was not working.
Reply With Quote
  #4  
Old 12th January 2007, 21:39
martinfst martinfst is offline
Senior Member
 
Join Date: Dec 2006
Location: Hilversum, The Netherlands
Posts: 873
Thanks: 1
Thanked 14 Times in 13 Posts
Send a message via MSN to martinfst Send a message via Skype™ to martinfst
Red face Sorry for the noise

Wow, I believe I overlooked an essential point. The testuser I created did not have the ftp checkbox ticked. As such ISPC always did reset the shell back to /dev/null by means of the 30 minute cron scripts. Not having this tick for a user means KEEP OUT completely from this system. Which is exactly what it needs to do.

When setting the ftp tick box for this user, ISPC did set the shell to /bin/false as it should.

My humble apologies to the developers, as this function is doing what it supposed to do. Please ignore my suggestion to change the code. I'll stay low for a while .....
Reply With Quote
  #5  
Old 13th January 2007, 16:28
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,853
Thanks: 781
Thanked 1,558 Times in 1,477 Posts
Default

Quote:
Originally Posted by martinfst
Wow, I believe I overlooked an essential point. The testuser I created did not have the ftp checkbox ticked. As such ISPC always did reset the shell back to /dev/null by means of the 30 minute cron scripts. Not having this tick for a user means KEEP OUT completely from this system. Which is exactly what it needs to do.

When setting the ftp tick box for this user, ISPC did set the shell to /bin/false as it should.

My humble apologies to the developers, as this function is doing what it supposed to do. Please ignore my suggestion to change the code. I'll stay low for a while .....
That's right. If you give a user /bin/false as shell, he will have FTP access, no matter what you specify in the ISPConfig interface. Users without FTP access therefore get /dev/null as shell.
__________________
Falko
--
Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Anything I can do against illegal login-requests? schmidtedv Installation/Configuration 17 7th November 2008 10:25
how to "kick" a shell user Tenaka Server Operation 12 16th June 2008 23:56
installing Perl module GD - ran into problems Tenaka Installation/Configuration 6 19th September 2006 10:32
ispconfig and mambo shajazzi Installation/Configuration 70 28th March 2006 20:29
Statistic not working mzo Installation/Configuration 13 24th February 2006 13:12


All times are GMT +2. The time now is 07:13.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Sponsored Links: Unified Communications: Thoughts, Strategies and Predictions
Join the discussion.
www.seamlessenterprise.com

IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com

Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com

Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com

Red Hat Virtual Experience - a free virtual event. Dec. 9th