Bug 2928 - Add a --norc option to pass to shells which support a --norc option
Summary: Add a --norc option to pass to shells which support a --norc option
Status: NEW
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: -current
Hardware: All Linux
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-09 08:12 AEDT by Avram Lubkin
Modified: 2018-11-09 08:12 AEDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Avram Lubkin 2018-11-09 08:12:42 AEDT
The goal with this would be to allow syntax such as this:
ssh --norc serverA best_command_ever

With shells that support it, like BASH, this prevents ~/.bashrc from being sourced.

Shells would have to have some sort of table to determine the option this corresponds to.

bash: --norc
ksh: --norc
zsh: --no-rcs
csh: -f

Background:

While there may be other use cases, my use case is for environments utilizing Kerberos for NFS home directories and authentication. The use can use Kerberos to log onto a system without entering a password, but does not access to their home directory without running kinit. When using a login shell, the user can be prompted for their password if they do not have a valid TGT. When running a command over a remote shell, the home directory is not used, but rc/startup files may still be sourced. In the case or bash, an attempt is always made to source ~/.bashrc unless the --norc or --rcfile options are given. This does not prevent running the command, but result in an error message "bash: /home/user1/.bashrc: Permission denied"

Other use cases I've seen searching the Internet were mostly related to suppressing erroring or undesired code with .bashrc.

Related issues:
This would not prevent the error "Could not chdir to home directory /home/user1: Permission denied" when no home directory is present. Perhaps a --no-home option that implies --norc would help with that?