Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Thread Tools Display Modes
  #1   (View Single Post)  
Old 13th April 2017
rain1 rain1 is offline
New User
Join Date: Apr 2016
Posts: 5
Default trouble sourcing env vars


I want to get some env vars automatically loaded for my user, so I put them into ~/.kshrc and export them. I have also put export ENV=$HOME/.kshrc in ~/.profile.

I can source this file manually . ~/.kshrc and it works great.

When I ssh as root then su rain1 it is not sourcing my env vars. When I su -l rain1 it does load them.

Please can you help me to make it load them automatically every time? Thanks!
Reply With Quote
  #2   (View Single Post)  
Old 13th April 2017
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
Join Date: May 2008
Location: USA
Posts: 6,292

  • Consider best practice: avoid ever logging in (or using ssh to log in) as root. Log in as rain1, and use su(1) or doas(1) when you need to temporarily issue commands as root.
  • The su(1) program does not run a login shell unless, as you have done, you add the -l option. You can create an alias command to do this, see ksh(1).
Reply With Quote

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
LCD Backlight Trouble zer0x OpenBSD General 3 24th July 2009 08:22 AM
dd+user=trouble graudeejs FreeBSD Security 4 26th September 2008 03:48 PM
Trouble with ZFS switch dewarrn1 FreeBSD General 2 11th September 2008 11:58 PM
Trouble with ftp with pf enabled kasse FreeBSD General 8 24th August 2008 11:25 PM
Firewire trouble - Please help! cssgalactic FreeBSD General 13 25th June 2008 08:24 PM

All times are GMT. The time now is 10:09 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick