如何使用python脚本输入集群密码

时间:2018-05-14 20:04:09

标签: python cluster-computing hpc

我正在尝试编写一个python脚本,它使用os.system()登录HPC集群(我有一个帐户)并将文件从集群传输到本地系统。我能够scp键入password命令。但是,在那之后,当我被要求输入密码时,我对我必须做的事情感到有点困惑(假设我的密码是os.system('password'))。我尝试了'password'并打印import os import sys password = 'password' clusterpath = 'myname@cluster.hpc1.cs.univ.edu:/Projects/re* ' localpath = 'Projects/.' os.system('scp ' + clusterpath + localpath) ,但它们无效。

这是我写的python脚本:

self.ref.child("users").child(userID).observe(.value, with: {
        (snapshot) in
        let value = snapshot.value as? NSDictionary
        let userId = value?["id"] as! String
        let username = value?["username"] as! String
        let email = value?["userEmail"] as! String
        let profilePictureUrl = value?["profilePicture"] as! String

        let post = Post(id: id, tags: tags, facultyName: facultyName, courseName: courseName, questionTitle: questionTitle, questionText: questionText, dateAndTime : dateAndTime, username: username)

        if userID == Auth.auth().currentUser?.uid {
            self.posts.insert(post, at: 0)
        }

        self.postDictionary[id] = post

        let member = User(id: userId, username: username, email: email, profilePicture: profilePictureUrl)

        if post.username == member.username {
            self.userDictionary[id] = member
        }

        self.tableView.reloadData()
    })

当我执行此脚本时,系统会要求我输入群集的密码。如何通过此python脚本输入群集帐户的密码?

0 个答案:

没有答案
相关问题