Ethical Hacking

Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package.
Computer Forensics Training at InfoSec Institute

Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors.




Network Security Secure-Shell
[Top] [All Lists]

Re: Locking down ssh config in large env

Subject: Re: Locking down ssh config in large env
Date: Wed, 29 Sep 2004 20:05:55 -0400

You could easily do something like this:

diff -r -u openssh-3.8.1p1/ssh.c openssh-3.8.1p1-patched/ssh.c
--- openssh-3.8.1p1/ssh.c 2004-03-21 17:36:01.000000000 -0500
+++ openssh-3.8.1p1-patched/ssh.c 2004-09-29 20:03:07.305991536 -0400
@@ -168,7 +168,7 @@
int i, opt, exit_status;
u_short fwd_port, fwd_host_port;
char sfwd_port[6], sfwd_host_port[6];
- char *p, *cp, *line, buf[256];
+ char *p, *cp, buf[256];
struct stat st;
struct passwd *pw;
int dummy;
@@ -422,12 +422,8 @@
no_tty_flag = 1;
break;
case 'o':
+ /* Silently discard any config options on the command line. */
dummy = 1;
- line = xstrdup(optarg);
- if (process_config_line(&options, host ? host : "",
- line, "command-line", 0, &dummy) != 0)
- exit(1);
- xfree(line);
break;
case 's':
subsystem_flag = 1;
@@ -521,22 +517,8 @@
log_init(av[0], options.log_level == -1 ? SYSLOG_LEVEL_INFO : options.log_level,
SYSLOG_FACILITY_USER, 1);


- /*
- * Read per-user configuration file. Ignore the system wide config
- * file if the user specifies a config file on the command line.
- */
- if (config != NULL) {
- if (!read_config_file(config, host, &options))
- fatal("Can't open user config file %.100s: "
- "%.100s", config, strerror(errno));
- } else {
- snprintf(buf, sizeof buf, "%.100s/%.100s", pw->pw_dir,
- _PATH_SSH_USER_CONFFILE);
- (void)read_config_file(buf, host, &options);
-
- /* Read systemwide configuration file after use config. */
- (void)read_config_file(_PATH_HOST_CONFIG_FILE, host, &options);
- }
+ /* Read systemwide configuration file. Ignore any user configuration. */
+ (void)read_config_file(_PATH_HOST_CONFIG_FILE, host, &options);


       /* Fill configuration defaults. */
       fill_default_options(&options);




This should put it in some sort of nazi mode. Also look at "IgnoreUserKnownHosts" in the sshd_config man page.




Atro Tossavainen wrote:

Robert Hajime Lanning wrote:



Actually if the .ssh directory is owned by root (and everything in it)
with the user not having write access to it, the user cannot delete the
.ssh directory.



I have just confirmed this on Linux. You neglected to mention that the user can rename such a directory, which (while not removing the actual contents of those files) accomplishes the desired effect none- theless as the user can proceed to create their own .ssh directory.




<Prev in Thread] Current Thread [Next in Thread>