LinuxQuestions.org
Review your favorite Linux distribution.
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 06-14-2010, 10:30 AM   #1
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
force to use default profile into ssh connection


Hello folks,

Is there any setting to connect ssh server using default profile.

for example if I run

ssh user@ssh_server_ip '/bin/bash --norc --noprofile'
it will skip user's login profile(/etc/profile,/etc/bashrc,~/.bashrc,~/.bash_profile)

Can i do some settings in ssh server that deny profile skipping by client.


Thanks in advance.
 
Old 06-14-2010, 02:52 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
It does and it doesn't skip it... What it does is this--

It connects to the host, runs the remote shell (profile, rc, and all) then runs bash --norc --noprofile and presents that to the user.

If you want to test this put "echo 'Running .bashrc'" at the bottom of your .bashrc file for the account and connect by the above command line.

You'll see--
Code:
user@host's password: 
Running .bashrc
If you want to ensure no matter what happens that system profile gets run you might want to look into ForceCommand and UseLogin (breaks x11 forwarding.)
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I force and SSH connection to timeout after 60 minutes? abefroman Linux - Server 1 08-14-2009 08:07 PM
samba pdc: force 1 mandatory profile bluesky2005 Linux - Server 2 07-30-2008 04:04 PM
Message at boot: "Choose a profile: 'default' or 'default.backup' " rm_-rf_windows Mandriva 1 07-07-2007 08:05 AM
cron force user profile kcella Linux - Newbie 1 10-14-2006 02:41 PM
Default profile HeReigns Linux - Networking 3 01-16-2006 05:07 PM

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

All times are GMT -5. The time now is 06:54 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