LinuxQuestions.org
Help answer threads with 0 replies.
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 04-08-2006, 10:00 AM   #1
piforever
Member
 
Registered: Dec 2005
Distribution: CentOS 5 - Debian 5
Posts: 112

Rep: Reputation: 15
Is this possible....no home directory


Is it possible to create a user just for tunneling?? so the system authenticate him but he does not have a home directory so he can not login and browse the system......i am using this account from different terminals and in case someone was tracking what i actually type(id/pass) it will not be that series.....


thnx,
 
Old 04-08-2006, 12:08 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
yes, that's totally possible, just set their shell to something like /sbin/nologin their home to /dev/null and whilst they can authenticate they can not actually log in.
 
Old 04-08-2006, 12:45 PM   #3
piforever
Member
 
Registered: Dec 2005
Distribution: CentOS 5 - Debian 5
Posts: 112

Original Poster
Rep: Reputation: 15
brilliant....thank you very much.

I got this when I tried to login
Code:
Could not chdir to home directory /dev/null: Not a directory
This account is currently not available.
can i change the message??!! or eliminate it all??!! let us say this user is from a certain group and i want to issue a specific message for this group...


*EDIT*

The user is not connected....so I can not actually use this method for tunneling!!! Any suggestions??

Code:
/usr/sbin/useradd -s/sbin/nologin -d/dev/null someuser

Last edited by piforever; 04-08-2006 at 12:48 PM.
 
Old 04-09-2006, 12:48 PM   #4
raskin
Senior Member
 
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (http://nixos.org)
Posts: 1,900

Rep: Reputation: 69
Try - though possibly it's less secure (I don't see why would it, but...) - setting 'shell' to some Unix-shell script echoing various curses and exiting.
 
Old 04-09-2006, 01:38 PM   #5
piforever
Member
 
Registered: Dec 2005
Distribution: CentOS 5 - Debian 5
Posts: 112

Original Poster
Rep: Reputation: 15
Can you give me an example??
 
Old 04-09-2006, 05:03 PM   #6
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
What kind of tunneling do you want the user to be able to do? If you just want him to tunnel HTTP traffic, you might be better served just setting up Squid or another proxy server.

I'm not sure if there's an easier way to do it than to write a little "shell" that basically just holds the connection open for the proxy traffic. At this point you might be even better served by implementing a simple SSL-based VPN so you don't have to mess with it. There are packages like FreeSwan that can help but I haven't ever used them.
 
Old 04-10-2006, 01:44 AM   #7
live_dont_exist
Member
 
Registered: Aug 2004
Location: India
Distribution: Redhat 9.0,FC3,FC5,FC10
Posts: 257

Rep: Reputation: 30
Does this help..or did I miss something??

***********
[arvind@arvind Scripts]$ su -
Password:
[root@arvind ~]# useradd -s /sbin/nologin -u 61111 -g 10 -c "VPN User" vpn
[root@arvind ~]# passwd vpn
Changing password for user vpn.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.
[root@arvind ~]# grep vpn /etc/passwd
vpn:x:61111:10:VPN User:/home/vpn:/sbin/nologin
[root@arvind ~]# su - vpn
This account is currently not available.
[root@arvind ~]#
***********
 
Old 04-10-2006, 06:47 PM   #8
piforever
Member
 
Registered: Dec 2005
Distribution: CentOS 5 - Debian 5
Posts: 112

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by live_dont_exist
Does this help..or did I miss something??
Thanx....but this is not what we are talking about....
 
Old 04-10-2006, 06:51 PM   #9
piforever
Member
 
Registered: Dec 2005
Distribution: CentOS 5 - Debian 5
Posts: 112

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by btmiller
What kind of tunneling do you want the user to be able to do? If you just want him to tunnel HTTP traffic, you might be better served just setting up Squid or another proxy server.

I'm not sure if there's an easier way to do it than to write a little "shell" that basically just holds the connection open for the proxy traffic. At this point you might be even better served by implementing a simple SSL-based VPN so you don't have to mess with it. There are packages like FreeSwan that can help but I haven't ever used them.
Thanx.....nice info, i'm looking at this at the moment....i'll post back if i successfully implemented those ideas....
 
Old 04-12-2006, 10:12 PM   #10
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Rep: Reputation: 30
Check the prog below, I read about it at packetstormsecurity but haven't tested it myself:


Sleep Dummy Shell

This is a simple do-nothing, sleep-forever program that can be used as a login shell (in Linux or Unix) to keep the connection open but without interactive shell. We use it to create SSH accounts for users who will only use them for SSH-tunneling; to create an encrypted tunnel to our servers (for example to connect securely to database servers like mySQL, PostgreSQL, etc).

http://www.mariovaldez.net/software/sleepshell/

Last edited by pk21; 04-12-2006 at 11:02 PM.
 
Old 04-13-2006, 12:55 PM   #11
piforever
Member
 
Registered: Dec 2005
Distribution: CentOS 5 - Debian 5
Posts: 112

Original Poster
Rep: Reputation: 15
WOW!! You are my savior.....just what I was looking for....

Regards,

The site is a bit scary!!

Last edited by piforever; 04-13-2006 at 01:20 PM.
 
Old 04-13-2006, 07:58 PM   #12
pk21
Member
 
Registered: Jun 2002
Location: Netherlands - Amsterdam
Distribution: RedHat 9
Posts: 549

Rep: Reputation: 30
pk21 to the rescue

Source code looks very simple, but is seems to work fine. Even has some sort of keepalive(an asterisk every 10-seconds)
 
Old 04-14-2006, 05:19 AM   #13
piforever
Member
 
Registered: Dec 2005
Distribution: CentOS 5 - Debian 5
Posts: 112

Original Poster
Rep: Reputation: 15
Thanx for that...I was thinking...whether the code is efficient and no vulnerabilities are associated with it?? I will go for it then...many thnx
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



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

All times are GMT -5. The time now is 02:52 PM.

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