diff --git a/mdt/config.py b/mdt/config.py
index db101d0..4634e8f 100644
--- a/mdt/config.py
+++ b/mdt/config.py
@@ -5,6 +5,9 @@
 CONFIG_KEYSDIR = os.path.join(CONFIG_BASEDIR, "keys")
 CONFIG_ATTRDIR = os.path.join(CONFIG_BASEDIR, "attribs")
 
+DEFAULT_USERNAME = "mendel"
+DEFAULT_SSH_COMMAND = "ssh"
+
 class Config:
     def __init__(self):
         self.ensureConfigDirExists()
@@ -17,12 +20,13 @@
         if not os.path.exists(CONFIG_ATTRDIR):
             os.makedirs(CONFIG_ATTRDIR, mode=0o700)
 
-    def getAttribute(self, name):
+    def getAttribute(self, name, default=None):
         path = os.path.join(CONFIG_ATTRDIR, name)
         if os.path.exists(path):
             with open(path, "r") as fp:
                 return fp.readline().rstrip()
-        return None
+
+        return default
 
     def setAttribute(self, name, value):
         path = os.path.join(CONFIG_ATTRDIR, name)
@@ -34,10 +38,20 @@
         if os.path.exists(path):
             os.unlink(path)
 
-    def defaultDeviceName(self, devicename=None):
+    def preferredDevice(self, devicename=None):
         if not devicename:
-            return self.getAttribute("devicename")
-        self.setAttribute("devicename", devicename)
+            return self.getAttribute("preferred-device")
+        self.setAttribute("preferred-device", devicename)
+
+    def username(self, username=None):
+        if not username:
+            return self.getAttribute("username", DEFAULT_USERNAME)
+        self.setAttribute("username", username)
+
+    def sshCommand(self, command=None):
+        if not command:
+            return self.getAttribute("ssh-command", DEFAULT_SSH_COMMAND)
+        self.setAttribute("ssh-command", command)
 
     def getKey(self, keyname):
         path = os.path.join(CONFIG_KEYSDIR, keyname)
diff --git a/mdt/devices.py b/mdt/devices.py
index 8aac28a..b1e85eb 100644
--- a/mdt/devices.py
+++ b/mdt/devices.py
@@ -6,14 +6,14 @@
 class DevicesCommand:
     def __init__(self):
         self.discoverer = Discoverer()
-        self.devicename = Config().defaultDeviceName()
+        self.device = Config().preferredDevice()
 
     def run(self, args):
         sleep(1)
         print('Devices found:')
         discoveries = self.discoverer.discoveries
         for host, address in discoveries.items():
-            if self.devicename and host == self.devicename:
+            if self.device and host == self.device:
                 print('{0}\t\t({1},default)'.format(host, address))
             else:
                 print('{0}\t\t({1})'.format(host, address))
